Qt基础内容

// 模态对话框

// QDialog dlg(this);

// dlg.exec();

// 模态对话框

// QDialog *dlg2= new QDialog(this);

// dlg2->show();

// dlg2->setAttribute(Qt::WA_DeleteOnClose);

/* // 错误提示对话框

QMessageBox::critical(this, "错误", "critical");

// 信息提示对话框

QMessageBox::information(this, "信息", "information");

// 警告提示对话框

QMessageBox::warning(this, "警告", "warning");

// 询问提示对话框

if (QMessageBox::Save == QMessageBox::question(this, "询问", "question", QMessageBox::Save | QMessageBox::Cancel, QMessageBox::Save))

{

qDebug() << "点击的是保存按钮";

}

else

{

qDebug() << "点击的是取消按钮";

} */

// 颜色对话框

// QColor color = QColorDialog::getColor();

// qDebug() << color.redF() << color.greenF() << color.blueF();

// 文件选择对话框

// QString filepath = QFileDialog::getOpenFileName(this, "打开文件","E:/","Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)");

// qDebug() << filepath.toUtf8().data();

// 字体选择对话框

bool *flag = nullptr;

QFont font = QFontDialog::getFont(flag, this);

qDebug() << font.toString();

你可能感兴趣的:(c++,qt,开发语言)