标签:
Constant | Value | Description |
QMessageBox::InvalidRole | -1 | The button is invalid. |
QMessageBox::AcceptRole | 0 | Clicking the button causes the dialog to be accepted (e.g. OK). |
QMessageBox::RejectRole | 1 | Clicking the button causes the dialog to be rejected (e.g. Cancel). |
QMessageBox::DestructiveRole | 2 | Clicking the button causes a destructive change (e.g. for Discarding Changes) and closes the dialog. |
QMessageBox::ActionRole | 3 | Clicking the button causes changes to the elements within the dialog. |
QMessageBox::HelpRole | 4 | The button can be clicked to request help. |
QMessageBox::YesRole | 5 | The button is a "Yes"-like button. |
QMessageBox::NoRole | 6 | The button is a "No"-like button. |
QMessageBox::ApplyRole | 8 | The button applies current changes. |
QMessageBox::ResetRole | 7 | The button resets the dialog‘s fields to default values. |
WrrMsg = new QMessageBox(QMessageBox::NoIcon, title, msg, QMessageBox::Ok, 0);
if(NULL!=WrrMsg->button(QMessageBox::Ok))
{
WrrMsg->button(QMessageBox::Ok)->setText("确 定");
}其中,title为QString类型的窗口标题,msg为QString类型的消息内容,QMessageBox()具体信息请参见Qt的相关帮助文档。
标签:
原文地址:http://www.cnblogs.com/findumars/p/4941347.html