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