THRESHE
4th August 2008, 14:09
Hi everyone
I need to place a check box in a message box and I try to do it like this
QMessageBox msgBox(QMessageBox::Warning, "", "Do You wish to save file?",
0, this, Qt::Sheet);
QCheckBox dontPrompt("Do not prompt again", &msgBox);
msgBox.addButton(&dontPrompt, QMessageBox::ActionRole);
QPushButton* pOK = msgBox.addButton("OK", QMessageBox::AcceptRole);
pOK->setMaximumSize(200, 31);
pOK->setMinimumSize(70, 31);
msgBox.exec();
But when I click a check Box the message box closes :confused:
Its very strange because I set Button role to QMessageBox::ActionRole which is
QMessageBox::ActionRole - Clicking the button causes changes to the elements within the dialog, without closing the dialog.
I need to place a check box in a message box and I try to do it like this
QMessageBox msgBox(QMessageBox::Warning, "", "Do You wish to save file?",
0, this, Qt::Sheet);
QCheckBox dontPrompt("Do not prompt again", &msgBox);
msgBox.addButton(&dontPrompt, QMessageBox::ActionRole);
QPushButton* pOK = msgBox.addButton("OK", QMessageBox::AcceptRole);
pOK->setMaximumSize(200, 31);
pOK->setMinimumSize(70, 31);
msgBox.exec();
But when I click a check Box the message box closes :confused:
Its very strange because I set Button role to QMessageBox::ActionRole which is
QMessageBox::ActionRole - Clicking the button causes changes to the elements within the dialog, without closing the dialog.