PDA

View Full Version : about scrollbar style



qtopiahooo
25th January 2007, 03:27
hi,all

according to my understanding, because there is no such setScrollbar functions
in the scrollview class, we can't create a new scrollbar class and set it. if different styles of scrollbar are needed in the scrollview and its subclasses, new QStyle subclasses must be created and the corresponding funtions about scrollbar must be implemented. then we can use QWidget::setStyle function to set the scrollbar style.

if every scrollview subclass has a different style of scrollbar, the same count of kinds of style classes must be implemented.

am i right? i am not sure if it is right. if so, it is very troublesome to change the style of scrollbar.

Thanks in advance.

wysota
25th January 2007, 14:34
You can try to substitute the scrollbar if you subclass the scrollview, but you'll have to look into the sources because you'd have to reconnect all the signals, etc. I think you'll achieve your goal faster by implementing a style proxy (http://wiki.qtcentre.org/index.php?title=Proxy_Style).