1. QColorDialog
QColor color = QColorDialog::getColor(Qt::white,this);
//
QString msg = QString("r:%1, g:%2, b%3").arg(QString::number(color.red()),
QString::number(color.green()),QString::number(color.blue()));
QMessageBox::information(this,"RGB",msg);
2. QMessageBox
QMessageBox::information(NULL,"information","good boy");
QMessageBox::critical(NULL,"critical","RI O");
QMessageBox::warning(NULL,"warning","you are die");
QMessageBox::about(NULL,"about","about me");
QMessageBox::question(NULL,"question","why?");
QMessageBox::StandardButton rb = .....
if (rb == QMessageBox::Yes)
生成对象刚:
if (message.exec() == QMessageBox::Yes)