Results 1 to 5 of 5

Thread: 4.3: Styling vertical QSlider

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Location
    Rome
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question 4.3: Styling vertical QSlider

    Hi all !

    I cannot find the way to style a vertical QSlider, the qss code that I use for the horizontal slider is:

    QSlider::groove:horizontal
    {
    border-image: url(qss/sl_groove.png) 1;
    border-width: 1;
    height: 1px;
    }

    QSlider::handle:horizontal
    {
    image: url(qss/h_handle.png);
    top: -6px;
    }

    I use the same code (changing height with width) for the vertical pseudo-states but the slider handle doesn't move anymore and seems to move horizontally !?!

    Probably something is missing but I don't know what...

    Any suggestions about that ?

    Thanks in advance,

    Angelo

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: 4.3: Styling vertical QSlider

    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Location
    Rome
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: 4.3: Styling vertical QSlider

    Jpn: I know this article (I made a lot of request about that to girish ) but every widget have different style behaviour: every style sheet definition could have different mandatory parameters to work depending on the widget to style and the pseudo-states to style.

    Angelo

  4. #4
    Join Date
    Jan 2007
    Location
    Rome
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: 4.3: Styling vertical QSlider

    I use this code,

    Qt Code:
    1. QSlider::groove:vertical
    2. {
    3. background: blue;
    4. border-color: blue;
    5. border-width:1 px;
    6. width: 3px;
    7. }
    8.  
    9. QSlider::handle:vertical
    10. {
    11. subcontrol-position: center center;
    12. width: 10px;
    13. background-color: red;
    14. border-color: black;
    15. border-width: 1px;
    16. border-style: solid;
    17. }
    To copy to clipboard, switch view to plain text mode 

    But I cannot move the handle, surely something is still missing, I try to use min-height as suggested by the documentation without any good result.

    Any suggestion ?

    Angelo

  5. #5
    ucomesdag Guest

    Default Re: 4.3: Styling vertical QSlider

    Got the same problem here... Guess we have to wait for 4.3.1 and file a bug in the mean time...

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
  •  
Qt is a trademark of The Qt Company.