[Qt-interest] setting background color of QMessageBox
Chandru...
sekarwagmare at gmail.com
Sat May 23 13:52:49 CEST 2009
thank you very much ... i completed it ..
On Sat, May 23, 2009 at 5:07 PM, Oliver Demetz <
forenbeitraege at oliverdemetz.de> wrote:
> Look into QApplication::setStyleSheet
> or the manual ;-)
>
> Oliver Demetz schrieb:
> > Hi
> >
> > You're not using the messagebox that you specified the stylesheet for.
> > QMessageBox msgBox;
> > msgBox.setStyleSheet(QString::fromUtf8("background-color: rgb(241, 241,
> > 241);"));
> > int ret = msgBox.warning(...)
> >
> >
> > Chandru... schrieb:
> >> 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
> >>
> >>
> >> ------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> Qt-interest mailing list
> >> Qt-interest at trolltech.com
> >> http://lists.trolltech.com/mailman/listinfo/qt-interest
> >
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
WAGMARE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090523/b5c76451/attachment.html
More information about the Qt-interest-old
mailing list