PDA

View Full Version : Widgets Part of the QScrollBar



smhall316
15th January 2011, 14:10
I was curious if there was a way to access the various widgets which make up the QScrollBar. For instance you have the scroll arrows, the slider and the page control area where the slider is dragged across. I wanted to know if there was a way to access these various widgets directly. I have poured through the online help and unless I am blind, I just don't see how. Thanks for any help.

SixDegrees
15th January 2011, 14:45
You can have a look at the widget's source code. What goes on in there won't be documented, but the constituent widgets will reside in either the protected or private section of the class. Assuming that's how the widget was built; it's also possible the bits and pieces are simply painted and managed by the class itself.

If they exist and they're in the protected section, you can gain access to them by extending the class. If they're private, you're out of luck.

Note that this sort of manipulation carries a fairly high risk of breaking code when built against future releases if the underlying widgets change.