Python PyQt5: How to show an error message with PyQt5

前端 未结 6 1289
别那么骄傲
别那么骄傲 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:51

    Assuming you are in a QWidget from which you want to display an error message, you can simply use QMessageBox.critical(self, "Title", "Message"), replace self by another (main widget for example) if you are not is a QWidget class.

提交回复
热议问题