QMessageBox::question(this,"问你个问题","are you happy",QMessageBox::Yes|QMessageBox::Close, QMessageBox::Yes ); //倒数1,2 选项 和 默认值
颜色对话框 QColor color=QColorDialog::getColor(QColor(255,0,0)); // get color code
qDebug()<<"red:"<<color.red();
文件对话框 QFileDialog::getOpenFileName(this,"open files","C:\\Users\\acer\\Desktop","(*.docx)");
返回值是 文件路径 需要加双斜杠 只得文件的参数,其他文件后缀名可查看属性
文字对话框
bool la;
QFont font=QFontDialog::getFont(&la); // bool值必需 其他参数值非必须 inside function only allow the ptr of name
qDebug()<<"font size:"<<font.family().toUtf8().data()<<"大小"<<font.pointSize()<<"italic:"<<font.italic()<<"bold:"<<font.bold();
//系统 纯对话框 QMessageBox::/*question()*//*critical()*//*information()*//*warning()*/
// q font color file dialog 分别返回对应的类型及参数值
常见对话框 颜色,文件等
最新推荐文章于 2021-10-19 15:16:54 发布