Qt-interest Archive, June 2007
Qt 4.3: QScrollBar style sheet definition
Message 1 in thread
Hi,
I'm using Qt 4.3 and I would like to use the style sheet to modify the
appearance of my applications.
A lot of new widgets are now supported and can be styled, but the
documentation about the new widgets and sub-controls
is missing.
After some tries I finally found the right way to style a QSlider while I
cannot style a QScrollBar widget.
Anyone has played with this new features and could provide some code
snippets (in particular for the QScrollBar) ?
Another things that I cannot achieve is applying a style only on a
particular class (for instance MyClass derived from a QSlider).
If someone has also some suggestions about this point, I'll be very happy !!
Thanks in advance,
Angelo
Message 2 in thread
I try using several type of selector without any results. The only case that
seems to works are two:
- Descendant Selector
- ID Selector
I would like to use the class selector and I surely miss something, just to
be more precise, why this qss snippet doesn't work ?
.QSlider::groove:horizontal
{
border-image: url(qss/sl_groove.png) 1;
border-width: 1;
height: 1px;
}
.QSlider::handle:horizontal
{
image: url(qss/h_handle.png);
top: -6px;
}
.ColorSlider::groove:horizontal
{
border-image: none;
}
.ColorSlider::handle:horizontal
{
image: url(qss/h_chandle.png);
top: -9px;
}
where ColorSlider inherit QSlider.
Angelo
2007/6/11, Ivan Kharin <korsar.akvis@xxxxxxxxx>:
>
> > Another things that I cannot achieve is applying a style only on a
> > particular class (for instance MyClass derived from a QSlider).
> > If someone has also some suggestions about this point, I'll be very
> happy !!
>
> Qt Assistant (Qt Style Sheets / Selector Rules)
>
> Class Selector
> .QPushButton
>
> Matches instances of QPushButton, but not of its subclasses.
> This is equivalent to *[class~="QPushButton"].
>
> --
> Ivan Kharin
>
>
Message 3 in thread
Angelo Moriconi wrote:
> Hi,
> I'm using Qt 4.3 and I would like to use the style sheet to modify the
> appearance of my applications.
> A lot of new widgets are now supported and can be styled, but the
> documentation about the new widgets and sub-controls
> is missing.
> After some tries I finally found the right way to style a QSlider while
> I cannot style a QScrollBar widget.
> Anyone has played with this new features and could provide some code
> snippets (in particular for the QScrollBar) ?
> Another things that I cannot achieve is applying a style only on a
> particular class (for instance MyClass derived from a QSlider).
> If someone has also some suggestions about this point, I'll be very
> happy !!
>
I blogged about this today. It will make its way into the 4.3
documentation pretty soon.
http://labs.trolltech.com/blogs/2007/06/12/styling-qprogressbar-and-qscrollbar/
Girish
--
[ signature omitted ]