简体   繁体   English

PyQt5 -- 显示对话框

[英]PyQt5 -- show dialog

在此处输入图像描述

First, you have to close the existing window otherwise it will not allow an opening new window or close the entire program.首先,您必须关闭现有的 window,否则将不允许打开新的 window 或关闭整个程序。 How can I do this in the Python library PyQt5. Python库PyQt5怎么办

To show a dialog in PyQt, you can use要在 PyQt 中显示对话框,您可以使用

error_dialog = QMessageBox()
error_dialog.setWindowTitle("Your title")
error_dialog.setText("Your message")
error_dialog.exec()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM