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" <an...@familiesomers.nl> > An: interest@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@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest -- http://www.carot.de http://www.triologue.de Email : alexan...@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 _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest