QMessageBox对话框

infoBox = QMessageBox()
infoBox.setIcon(QMessageBox.Question)
infoBox.setWindowTitle("初始化失败")
infoBox.setText("读取info.inf失败,因为没有找到此文件\n请将此文件放置到同级文件目录!\n 是否不加载配置继续操作?")
infoBox.setStandardButtons(QMessageBox.Ok|QMessageBox.No)
infoBox.exec_()
if infoBox.clickedButton().text() == "OK":
   print('YES pressed')
elif infoBox.clickedButton().text() == "&No":
   print('NO pressed')

 

posted @ 2019-04-25 10:59  zhangdingqu  阅读(426)  评论(0编辑  收藏  举报