Results 1 to 3 of 3

Thread: Customizing QScrollBar

  1. #1
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Customizing QScrollBar

    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
    Last edited by Jimmy2775; 1st February 2006 at 19:53.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Customizing QScrollBar

    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.

  3. #3
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Customizing QScrollBar

    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:



    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.

Similar Threads

  1. customizing QScrollbar
    By MarkoSan in forum Qt Programming
    Replies: 7
    Last Post: 15th October 2009, 19:51
  2. QScrollBar arrow display
    By sgg245 in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2009, 07:57
  3. QScrollBar arrow display
    By sgg245 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 16th February 2009, 07:36
  4. Can not cast into the derived class from QScrollBar
    By learning_qt in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2008, 11:23
  5. Replies: 2
    Last Post: 24th July 2008, 21:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.