[Qt-interest] QLineEdit background same as QFrame
Eckhard Jokisch
e.jokisch at orange-moon.de
Mon May 18 22:39:13 CEST 2009
Hi Neel,
look in designer for the word "palette" in the yellow QWidget properties.
in the right column of this line you can double-click on "change palette" and
there put a different colour in the "base" row.
BR
Eckhard
On Monday 18 May 2009 20:55:31 Neel Basu wrote:
> On Tuesday 19 May 2009 00:15:52 Ben Swerts wrote:
> > 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
>
> Thanks for your reply.
>
> I tried it programatically
> ui->toEdit->setBackgroundRole(QPalette::Base);
> and It didn't work.
>
> I didn't find anything like backgroundRole in designer
>
> Neel
>
> > > 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list