[Qt-interest] setting background color of QMessageBox
Chandru...
sekarwagmare at gmail.com
Sat May 23 12:49:34 CEST 2009
hi friends,
i am using QMessageBox to dispaly warning if the user press a pushButton ..
i coded like this:
-- QMessageBox msgBox;
msgBox.setStyleSheet(QString::fromUtf8("background-color: rgb(241,
241, 241);"));
int ret = QMessageBox::warning(this, tr("My Application"),
tr("<font color = red >Are you sure you want
to quit?.\n"
"Shut Down key is pressed </font >"),
QMessageBox::Ok | QMessageBox::Cancel);
switch (ret) {
case QMessageBox::Ok :
qApp->quit();
break;
case QMessageBox::Cancel :
break;
default :
break;
}
rendered using the default stylesheet of app .. it is pure black in
background color ..
the text are not visible ... so i use <font > in constructor of
QMessage::warning ..
but i cant set font color of buttons ... yes , no text were not visible ...
i try change the background color of QMessageBox .. but QPalette and
StyleSheet is not working ... please help ...
how to set backgroud color or color of the text in
QMessage::standardButton() ..
WAGMARE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090523/f49bfb3c/attachment.html
More information about the Qt-interest-old
mailing list