0

I'm trying to set pyqt default icons for my program but I get an error.

here is my function:

def show_pop(self):
        msg = QMessageBox()
        msg.setIcon(QMessageBox.Information)
        msg.setWindowTitle('mb demo')
        msg.setText('You Pressed Button')
        msg.exec()

The Error:

AttributeError: type object 'QMessageBox' has no attribute 'Information'. Did you mean: 'information'?

PN: I'm using pyqt6.

Pourixa
  • 3
  • 3

1 Answers1

0

I just solved the problem:

in pyqt6 you have to set default icons like this Example:

msg.setIcon(QMessageBox.Icon.Information)
Pourixa
  • 3
  • 3