###首先要調用
#include <QMessageBox>
###然后
QMessageBox msgBox;
msgBox.setWindowTitle("錯誤");
msgBox.setText("除數不能為零");
msgBox.exec();
###或者簡單點
QMessageBox::warning(this,"錯誤","除數不能為零");
###常用的彈出框類型
- Question For asking a question during normal operations.
- Information For reporting information about normal operations.
- Warning For reporting non-critical errors.
- Critical For reporting critical errors.