本文主要是介绍通用对话框 QMessageBox --20240902,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
# 通用对话框 QMessageBox
from PyQt5 import QtWidgets,QtCore
from PyQt5.QtWidgets import QMessageBox
from myDesigner1 import Ui_Form
import sys,timeclass mySignalSlot(QtWidgets.QWidget,Ui_Form):# 定义信号_signal = QtCore.pyqtSignal()def __init__(self):super(mySignalSlot, self).__init__()self.setupUi(self)self.pushButton.clicked.connect(self.msg)def msg(self):OK = QMessageBox.information(self,('这是标题'),('这是按钮1弹出的信息框'),QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No |QMessageBox.Cancel |QMessageBox.Close))if __name__ == '__main__':app = QtWidgets.QApplication(sys.argv)myshow = mySignalSlot()myshow.show()sys.exit(app.exec_())
这篇关于通用对话框 QMessageBox --20240902的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!