[Interest] Changing QSpinEdit color

"Alexander Carôt" alexander_carot at gmx.net
Wed Jun 6 16:07:18 CEST 2012


Thanks, André ! It works out well. I obviously need to spend more time working with style sheets !

Best

Alex 



-------- Original-Nachricht --------
> Datum: Wed, 06 Jun 2012 10:34:36 +0200
> Von: "André Somers" <andre at familiesomers.nl>
> An: interest at qt-project.org
> Betreff: Re: [Interest] Changing QSpinEdit color

> Op 5-6-2012 20:47, "Alexander Carôt" schreef:
> > Hi all,
> >
> > I have a question in context with QSpinEdit:
> >
> > On a Mac this call successfully changes the color of the spinEdit:
> >
> > spin->setAutoFillBackground(true);
> > spin->setPalette( *greenFgPalette );
> >
> > On Win, however, this call seems to be ignored - the spinEdit remains
> white. Can anyone tell me how to make it work under Win ?
> >
> > Thanks in advance,
> > best
> >
> > Alex
> >
> Styles are free to ignore the set palette, and some styles, especially 
> those using native rendering like on windows, do in fact ignore the 
> palette. However, all styles will obey the style sheet. So, instead of 
> the palette, use a style sheet.
> 
> spin->setStyleSheet("QSpinBox {background-color: rgb(0, 255, 0);}");
> 
> That should work on both platforms.
> 
> André
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
http://www.carot.de
http://www.triologue.de
Email : Alexander at Carot.de
Tel.: +49 (0)177 5719797



Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



More information about the Interest mailing list