Results 1 to 3 of 3

Thread: Qt 4.3 Style sheet, new features

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 2 Times in 2 Posts

    Default Re: Qt 4.3 Style sheet, new features

    Here is how you can style a normal vertical scrollbar. It is not pretty, but I'm sure with some border images it can be tailored according to your taste.

    Qt Code:
    1. QScrollBar::vertical {
    2. background:lightgray;
    3. border-color:black;
    4. border-style:dotted;
    5. width: 15px;
    6. margin-top:16px;
    7. margin-bottom:16px;
    8. }
    9.  
    10. QScrollBar::add-page:vertical,
    11. QScrollBar::sub-page:vertical {
    12. background: none;
    13. }
    14.  
    15. QScrollBar::add-line:vertical{
    16. height: 14px;
    17. background:darkGray;
    18. subcontrol-origin: margin;
    19. subcontrol-position: bottom;
    20. border-color:black;
    21. border-style:solid;
    22. border-width:1px;
    23. }
    24.  
    25. QScrollBar::sub-line:vertical {
    26. subcontrol-origin: margin;
    27. subcontrol-position: top;
    28. height: 14px;
    29. background:darkGray;
    30. border-color:black;
    31. border-style:solid;
    32. border-width:1px;
    33. }
    34.  
    35. QScrollBar::handle:vertical {
    36. background:red;
    37. min-height: 20px;
    38. background:gray;
    39. border-color:black;
    40. border-style:solid;
    41. border-width:1px;
    42. }
    43.  
    44. QScrollBar::add-line:pressed,
    45. QScrollBar::sub-line:pressed,
    46. QScrollBar::handle:pressed{
    47. background:lightgray;
    48. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to jens for this useful post:

    Angelo Moriconi (12th June 2007)

Similar Threads

  1. Qt Designer Style Sheet Resources
    By bjoernbg in forum Newbie
    Replies: 1
    Last Post: 24th January 2007, 07:12
  2. How to use style sheet
    By safknw in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 13:05

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.