Igor, Try using a styleSheet. I use this for QLineEdit but just tweaked it to show you how to do it with a QLabel so it's untested. Some of the options may not be used by QLabel so check the Qt docs to verify.
QString style = "QLabel{ color:#000000; background-color:#FFFFFF; selection-color:#FFFFFF; selection-background-color:#000000; font-family:Monospace; font-style:normal; font-size:12px; }"; label->setStyleSheet(style); Jonathan On Thu, Feb 13, 2014 at 12:56 AM, <igor.mironc...@gmail.com> wrote: > Hi. > > How to set white background to the QLabel? > > I use the next code to do it: > > QLabel * label = new QLabel( this ); > label->setBackgroundRole( QPalette::Base ); > > But it give no effect. What I should do else? Thanks. > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest