1) 自定义的
QMessageBox msgBox(QMessageBox::NoIcon,"caption","context");
QPushButton *acceptButton = msgBox.addButton(tr("accept"), QMessageBox::AcceptRole);msgBox.addButton(QMessageBox::Cancel);
msgBox.setDefaultButton(continueButton);
msgBox.exec();
if (msgBox.clickedButton() == acceptButton)
......
2)标准的
QMessageBox::information(NULL, "Title", "Content", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);