View Full Version : customizing QScrollbar
MarkoSan
30th May 2008, 16:34
Hi to all!
I subclassed QScrollBar but now I have two questions:
How do I repaint slider with some texture (I've made texture using photoshop and converted it to .png file)
How do I repaint both arrows with custom shape/custom picture?
Is it right way to reimplement paintEvent()?
The answer is: don't subclass but use style sheets. :)
MarkoSan
30th May 2008, 17:17
Ok, but I want to do it hard way!!!!!
Ok, but I want to do it hard way!!!!!
Well, good luck. Take a look at QScrollBar::paintEvent() implementation. It's all done with styles. You might be able to change the background brush with palettes but for custom arrow controls you'll need a custom style. At least if you want to do it the right way (tm).
metdos
15th October 2009, 09:52
The answer is: don't subclass but use style sheets. :)
I used style sheet, but it does not look very good, and also examples in qt documentation don't seem enough. http://doc.trolltech.com/4.4/stylesheet-examples.html#customizing-qscrollbar
Do you have any good examples of style sheet applied on QScroolBar?
Thanks.
axeljaeger
15th October 2009, 15:26
Do it using a QStyle, it is hard enough.
metdos
15th October 2009, 18:48
Do it using a QStyle, it is hard enough.
Do you have any suggestion for changing the appearance of QScrollBar?
axeljaeger
15th October 2009, 18:51
Reimplement drawComplexControl and watch out for CC_ScrollBar
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.