QMessageBox
header:会话窗标题
info:会话窗内容
#弹出5种不同类型的消息框
reply1=QMessageBox.information(self,"title","infocontent",QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
reply2=QMessageBox.question(self,"title","questioncontent",QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
reply3=QMessageBox.warning(self,"title","warningcontent",QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
reply4=QMessageBox.critical(self,"title","criticalerrorcontent",QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
reply5=QMessageBox.about(self,"title","content")
QtWidgets.QMessageBox.Yes
QtWidgets.QMessageBox.No
QtWidgets.QMessageBox.Ok
1 def clearResult(self):
2 reply = QMessageBox.question(self,"Question",
3 "确认要删除吗?",
4 QMessageBox.Yes|QMessageBox.No,
5 QMessageBox.No)
6 if reply == QMessageBox.Yes:
7 self.result_textEdit_2.clear()
8 else:
9 return