pyqt5 QMessageBox小结
来源:互联网 发布:贪吃蛇大战下载软件 编辑:程序博客网 时间:2024/06/05 08:53
pyqt5 QMessageBox小结
前面4个都有用到
1、Replay box:
reply = QMessageBox.question(self, 'Message',"Are you sure to quit?",QMessageBox.Yes,QMessageBox.No)if reply == QMessageBox.Yes:event.accept()else:event.ignore()
2、About box:
QMessageBox.about(self, "About Search System", "The Search System demonstrates how to search images")
3、warning box
QMessageBox.warning(self, "warning", "The save directory is empty",QMessageBox.Cancel)
4、information box
QMessageBox.information(self,"Tips","Save the current frame successfully!",QMessageBox.Yes)
QMessageBox.aboutQt(self,"About Qt")
6、critical box
QMessageBox.critical(self,"Critical", self.tr("错误!"))
7、自定义box(还没有尝试)
def slotCustom(self): customMsgBox=QMessageBox(self) customMsgBox.setWindowTitle("Custom message box") lockButton=customMsgBox.addButton(self.tr("锁定"), QMessageBox.ActionRole) unlockButton=customMsgBox.addButton(self.tr("解锁"), QMessageBox.ActionRole) cancelButton=customMsgBox.addButton("cancel",QMessageBox.ActionRole) customMsgBox.setText(self.tr("这是一个自定义消息框!")) customMsgBox.exec_() button=customMsgBox.clickedButton() if button==lockButton: self.label.setText("Custom MessageBox/Lock") elif button==unlockButton: self.label.setText("Custom MessageBox/Unlock") elif button==cancelButton: self.label.setText("Custom MessageBox/Cancel")
0 0
- pyqt5 QMessageBox小结
- PyQt5学习笔记07----通用对话框QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- QMessageBox
- PyQt5
- 合成模式(数据结构)
- Casino Malaysia Deposit 30 free 50 Promotion(casino malaysia, casino malaysia promotion, deposit pro
- ZJOI2017蒟蒻游记2
- Java开源工具iText在PDF文件中创建表格
- QT之GUI学习笔记(十三)----QInputDialog
- pyqt5 QMessageBox小结
- 242. Valid Anagram(C++)
- Spring 整合数据访问技术
- 搭建gtest测试环境 脚本
- ORA-00911 无效字符
- NYOJ 586 疯牛 (二分搜索答案)
- unity3d和建模关系
- Pandas 文本数据方法 repeat( )
- 平时笔记