PDA

View Full Version : QMessageBox buttons not sized correctly when using stylesheet



jhowland
28th April 2010, 16:44
I am using a QMessageBox in the standard way to query if the user really wants to quit. I intercept the closeEvent, call an OKToClose() function. It does this



bool AlvGUI::OKToClose()
{

int ret = QMessageBox::warning(this, tr("Alvin Pilot GUI"),
tr("You are quitting the Alvin Graphical User Interface.\n""Do you really want to quit?"),
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No,
QMessageBox::Cancel | QMessageBox::Escape);
if (ret == QMessageBox::Yes)
return true;
else if (ret == QMessageBox::Cancel)
return false;

return false;
}


when I don't use a stylesheet, everything works the way it should. However, when I use a stylesheet (that does not ever mention QMessageBox) the QPushButtons on the QMessageBox are sized too small, cutting off the text.

QPushButton occurs in my stylesheet, but I never set sizes, etc.

I have found a bug report that seems like it might be relevant

http://bugreports.qt.nokia.com/browse/QTBUG-10246

but I'm not explicity setting min-size. Any other ideas on what might be going on or how to fix it?

thanks