消息对话框QMessageBox类的基本用法
消息对话框QMessageBox类的基本用法
前言
此篇文章中介绍 PySide2 中消息对话框 QMessageBox 类的基本用法,包括 ”警告信息提示对话框 warning、信息提示对话框 information、询问并获取是否确认的对话框question” 等,会持续进行更新,有需要的读者可以点赞收藏,也欢迎在评论区进行讨论。
正文
QMessageBox 类的基类为 QDialog 类,QMessageBox 类由包含以下的几个子类:
- 警告信息提示对话框 : QMessageBox.warning()
- 信息提示对话 : QMessageBox.information()
- 询问并获取是否确认的对话框 : QMessageBox.question()
- 出错消息提示对话框 :QMessageBox.critical()
- 设置自定义信息的关于对话框:QMessageBox.about()
1、警告对话框 QMessageBox.warning()
QMessageBox.warning(self