QMessageBox简单使用


###首先要调用

#include <QMessageBox>

###然后

            QMessageBox msgBox;
            msgBox.setWindowTitle("错误");
            msgBox.setText("除数不能为零");
            msgBox.exec();
    

###或者简单点

QMessageBox::warning(this,"错误","除数不能为零");

###常用的弹出框类型

  1. Question For asking a question during normal operations.
  2. Information For reporting information about normal operations.
  3. Warning For reporting non-critical errors.
  4. Critical For reporting critical errors.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM