[Interest] Plastique style & stylesheets

Etienne Sandré-Chardonnal etienne.sandre at m4x.org
Tue Dec 24 14:51:37 CET 2013


OK thanks, I was not expecting a QPalette to work better than stylesheet
(isn't it handled the same way at the end?), but I will try it. I was not
expecting a simple color change to be an extensive customization.

This is for a color-proofing imaging software where dark backgrounds gives
better eye sensitivity than light ones, especially on potentially very
bright monitors. QStyle rewriting is an option, but at high cost, so any
simpler solution is welcome.

I've read your post here:
https://blog.qt.digia.com/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/

It seems that fusion it well color-customizable and platform-independent,
since I do not need any fanciness, this may be a good solution.


Thanks,

Etienne


2013/12/24 Bache-Wiig Jens <Jens.Bache-Wiig at digia.com>

>
> On 23 Dec 2013, at 12:17, Etienne Sandré-Chardonnal <
> etienne.sandre at m4x.org> wrote:
>
> > Hi,
> >
> > I am trying to use the plastique style and change its colors to a dark
> theme.
> >
> > However, simply doing :
> >
> > QWidget
> > {
> >     color: #b1b1b1;
> >     background-color: #323232;
> > }
> >
> > Messes several things including scrollbars:
> >
> > <plastique-styling.png>
> >
> >
> > As you can see, the double arrow in the bottom is removed, the round
> corners are lost, etc... So it seems that plastique is not fully stylable.
> >
> > Is there a workaround, or a more customizable style in Qt4? Or is it
> time to switch to Qt5 and fusion?
> >
> > Thanks,
> >
> > Etienne
>
> As others have already pointed out, when you do extensive customisation
> like this, style-sheets will fall back to using the same style on all
> platforms which happen to be windows style. Not all styles support palettes
> equally well and especially not in combination with style sheets. However
> in your case the workaround would be pretty simple. If all you want is to
> modify the palette, then you do not have to use style sheets at all. Simply
> create a custom QPalette with your preferred colors and apply this on your
> QApplication object at startup instead.
>
> Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131224/96bba356/attachment.html>


More information about the Interest mailing list