I found this thread because I had the same problem, but managed to solve it in a different way.
mBox.setWindowTitle("Dialog Title");
mBox.setText("Question?");
Qt::WindowFlags wFlags = mBox.windowFlags();
if(Qt::WindowCloseButtonHint == (wFlags & Qt::WindowCloseButtonHint))
{
wFlags = wFlags ^ Qt::WindowCloseButtonHint;
mBox.setWindowFlags(wFlags);
}
QMessageBox mBox;
mBox.setWindowTitle("Dialog Title");
mBox.setText("Question?");
mBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
Qt::WindowFlags wFlags = mBox.windowFlags();
if(Qt::WindowCloseButtonHint == (wFlags & Qt::WindowCloseButtonHint))
{
wFlags = wFlags ^ Qt::WindowCloseButtonHint;
mBox.setWindowFlags(wFlags);
}
To copy to clipboard, switch view to plain text mode
Bookmarks