Hi everyone
I need to place a check box in a message box and I try to do it like this
0, this, Qt::Sheet);
QCheckBox dontPrompt
("Do not prompt again",
&msgBox
);
msgBox.
addButton(&dontPrompt,
QMessageBox::ActionRole);
pOK->setMaximumSize(200, 31);
pOK->setMinimumSize(70, 31);
msgBox.exec();
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();
To copy to clipboard, switch view to plain text mode
But when I click a check Box the message box closes
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.
Bookmarks