Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
4.8.6, 5.4.0
-
None
-
Ubuntu 12.04 LTS 64 bit
Windows 7 64 bit
Description
- Have a simple MessageBox:
QMessageBox msgBox; msgBox.setText("Hey yo!"); msgBox.exec();
- Build and execute this:
No surprises here. - So far the MessageBox has only one button. Let's add another one:
QMessageBox msgBox; msgBox.setText("Hey yo!"); msgBox.addButton("Reject", QMessageBox::RejectRole); msgBox.exec();
- Build and execute this:
Huh? Still only one button? - Let's show the MessageBox before adding the button...
QMessageBox msgBox; msgBox.setText("Hey yo!"); msgBox.show(); msgBox.addButton("Reject", QMessageBox::RejectRole); msgBox.exec();
- Build and execute this:
So now there are both buttons??
When I see a function named addButton, I expect it to add a button and nothing else. Above all, I don't expect that this removes a button.
If there's a good reason for this behavior, then it should be documented clearly. Right now, this is not documented at all.
I don't think that the behavior of addButton should depend on whether show was called or not.
Attachments
Issue Links
- resulted from
-
QTBUG-39334 [REG 4->5.2] QMessageBox does not have button for closing if detailedText is set - addButton removes button
- Closed