Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.2.1, 5.3.0
-
None
-
Ubuntu 12.04 LTS 64 bit
Windows 7 64 bit
-
a149d2f73ec45084c589ef4211974ba50c0d4631. (4.6.2014, stable, 5.3.2?)
Description
Create a simple message box:
QMessageBox msgBox;
msgBox.setText("Hey yo!");
msgBox.exec();
It will look like this:
Now add detailedText to the message box:
QMessageBox msgBox; msgBox.setText("Hey yo!"); msgBox.setDetailedText("Boring..."); msgBox.exec();
Now it will look like this:
The "OK" button is gone. Pressing "Return" or "Escape" will show/hide the details.
Even when detailed text is available, the dialog should always have a button for properly closing it. By default, this should be the "OK" button. Pressing "Escape" should never show more details.
This is a regression as it works correctly in Qt 4.8.6 and 5.0.1.
This can be worked around by passing QMessageBox::Ok to the message box' ctor.
Update: This happens because calling QMessageBox::addButton removes the default button. Although this has already been the case in Qt 4.8.6, I think it is a bug because it is counter-intuitive and not even documented.
Attachments
Issue Links
- resulted in
-
QTBUG-41995 QMessageBox::addButton removes button - depending on whether QMessageBox::show was called
- Reported
For Gerrit Dashboard: QTBUG-39334 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
86388,3 | Work around missing default button | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
86724,1 | Do not clear default button in QMessageBox::setDetailedText(). | stable | qt/qtbase | Status: MERGED | +2 | 0 |