PDA

View Full Version : Customizing QScrollBar



Jimmy2775
1st February 2006, 19:36
Good day,

I am pretty new to QT so please forgive my ignorance. I would like to customize the look of the QScrollBar widget and use my own custom graphics for the slider, scroll arrows, and page control. Is this possible? If so, can someone either describe the process or direct me to a resource that could help me out?

I am aware that there is some documentation provided in the QStyle class reference, but more information to supplement this would be ideal.

Thanks

Jimmy

high_flyer
2nd February 2006, 12:46
I am aware that there is some documentation provided in the QStyle class reference, but more information to supplement this would be ideal.
What more information do you need?
What have you done so far, and where are you stuck?
Your question is very braod, please be more specific.

Jimmy2775
2nd February 2006, 19:01
I apologize for being vague. My project is still in the design phase and QT is new to me, so for the most part I am trying to get a sense of the difficulty/time involved in creating a custom style for my application.

Based on the example provided in the documentation it seems that I need to override the style's drawPrimitive method and paint the control's components myself. I am wondering, first of all, if there is any way to use existing graphics to create a custom style rather than manually painting the components myself - I doubt that this is possible, but it doesn't hurt to ask. Secondly, I am trying to determine the limitations of custom styles in QT. One of the requirements of the application I am developing is that it emulates the look and feel of another existing application. This previous application uses, for example, the scrollbar style depicted in this image:

http://www3.telus.net/public/jdutczak/images/scrollbar-example.GIF

Notice how the slider is rounded and the scroll arrows are concave to fit the slider? I would like to try to do this using QT but am uncertain if/how this is possible.