错误对话框:
//错误对话框QMessageBox::critical(this,"critical","错误");
信息对话框:
//信息对话框QMessageBox::information(this,"info","信息");
提问对话框:
//提问对话框//1.QMessageBox::question(this,"ques","提问");//2.QMessageBox::question(this,"ques","提问",QMessageBox::Save|QMessageBox::Cancel,QMessageBox::Cancel);
警告对话框:
//警告对话框QMessageBox::warning(this,"warning","警告");
其他标准对话框:
颜色对话框:
//其他标准对话框//颜色对话框QColor color = QColorDialog::getColor(QColor(255,0,0));qDebug()<<"r = "<<color.red()<<"g = "<<color.green()<<"b = "<<color.blue();
文件对话框:
//文件对话框
//返回值是 选取的路径
//1.QFileDialog::getOpenFileName(this,"打开文件","C:\\Users\\Tom\\Desktop");});//2.QFileDialog::getOpenFileName(this,"打开文件","C:\\Users\\Tom\\Desktop","*.txt");});
字体对话框:
//字体对话框
//返回所选字体bool flag;QFontDialog::getFont(&flag,QFont("华文彩云",36));