[Interest] White background of QLabel

Jonathan Greig redteam316 at gmail.com
Thu Feb 13 07:10:09 CET 2014

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; }";


On Thu, Feb 13, 2014 at 12:56 AM, <igor.mironchik at 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 at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140213/cd2a19c3/attachment.html>

More information about the Interest mailing list