[Qt-interest] Painting on Scrollbars

Girish Ramakrishnan girish at forwardbias.in
Thu Apr 16 07:09:10 CEST 2009


Freddie Witherden wrote:
> 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).
> 

You can get all the information using the QStyle API.
http://doc.trolltech.com/4.5/style-reference.html#scroll-bars
http://doc.trolltech.com/4.5/widgets-styles.html
http://doc.trolltech.com/4.5/qstyle.html

(You can a widget's style using QWidget::style()).

Girish



More information about the Qt-interest-old mailing list