Python PyQt5: How to show an error message with PyQt5

前端 未结 6 1288
别那么骄傲
别那么骄傲 2020-12-15 13:00

In normal Python (3.x) we always use showerror() from the tkinter module to display an error message but what should I do in PyQt5 to display exactly the same message type a

6条回答
  •  天涯浪人
    2020-12-15 13:59

    To show a message box, you can call this def:

    from PyQt5.QtWidgets import QMessageBox, QWidget
    
    MainClass(QWidget):
        def __init__(self):
            super().__init__()
    
        def clickMethod(self):
            QMessageBox.about(self, "Title", "Message")
    

提交回复
热议问题