Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
4.6.1, 5.8.0
-
None
-
MS WIndows XP SP 3
Description
The width of QPushButtons on a QMessageBox will not size large enough if a style sheet with 'min-width' is applied. The expectation is that the push buttons will be no smaller than min-width but should be able to expand to a large size.
See code:
#include <QtGui/QApplication>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMessageBox optionDialog(QMessageBox::Question, "Test Dialog", "Please Select an Option", QMessageBox::NoButton);
optionDialog.setStyleSheet("QPushButton
"); //<-- Dialog will size correctly if this line is commented out
optionDialog.addButton("Test", QMessageBox::AcceptRole);
optionDialog.addButton("Test a very longgggg text", QMessageBox::AcceptRole);
return optionDialog.exec();
}