[Qt-interest] QLineEdit background same as QFrame
Ben Swerts
benswerts at telenet.be
Mon May 18 20:45:52 CEST 2009
Hi Neel,
You need to set QPalette::Base instead of QPalette::Window. Just try it out
in Designer. That way you can see the effect immediately.
Greets,
Ben
> I've a QFrame and in that I've a QLIneEdit
> default background color of QLineEdit is white
> but I want to make its background color the default background color of
> the
> window.
> I've tried the following things but none of them worked.
> ui->toEdit->setBackgroundRole(QPalette::Window);
>
>
> ui->toEdit->setStyleSheet("background-color: "+QVariant(ui->toEdit-
> >palette().brush(QPalette::Window)).toString());
>
> They did not work. background color of the QLineEdit is still white
>
> any idea ??
>
> Thanks
> Neel
More information about the Qt-interest-old
mailing list