[Qt-interest] Painting on Scrollbars
Freddie Witherden
freddie at witherden.org
Thu Apr 16 00:17:08 CEST 2009
Hi,
I am wondering how to go about painting on the "page control" area of a
QScrollBar (by way of subclassing it). This can be seen here
http://doc.trolltech.com/4.5/images/qscrollbar-picture.png labelled as
"c". Looking at the API for QScrollBar and QAbstractSlider I see no
intuitive way of querying the dimensions of this region.
Furthermore, I am also interested in getting the dimensions of the
actual slider itself (so how wide it is and where it starts).
I am interested in this information because I am currently in the
process of writing a marked scrollbar widget (of similar ilk to those
found in many OS X applications). By having small lines - or marks - on
the scroll track it is possible to highlight regions of interest in the
scroll view. These could be compiler warnings/errors or the location of
matches in a find-and-replace search. However, to do this, one needs to
be able to get the dimensions of the scroll track in order to be able to
paint to it.
Regards, Freddie.
More information about the Qt-interest-old
mailing list