+ Reply to Thread
Results 1 to 4 of 4

Thread: Scrollbar background does not go solid (?) when using stylesheets

  1. Join Date
    Feb 2008
    Posts
    26
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Scrollbar background does not go solid (?) when using stylesheets

    As shown in the image attached, the following code gives me a scrollbar with a dotted background. I would like to make that background solid, but I can't seem to make Qt do that using the stylesheet mechanism.

    I was wondering if someone knows if this is either a bug, if it's supposed to work like this or if there's a work-around.

    I'm using Windows Vista, if that matters (I've noticed some other different behaviors as well, using Vista and Qt styles, that's why I mention it).

    Qt Code:
    1. QScrollBar:horizontal {
    2. background-color: blue;
    3. border: 1px solid black;
    4. margin: 0px 16px 0px 16px;
    5. }
    6.  
    7. QScrollBar::handle:horizontal {
    8. background: red;
    9. border: 1px solid yellow;
    10. }
    11.  
    12. QScrollBar::add-line:horizontal {
    13. border: 1px solid black;
    14. background: purple;
    15. width: 16px;
    16. subcontrol-position: right;
    17. subcontrol-origin: margin;
    18. }
    19.  
    20. QScrollBar::sub-line:horizontal {
    21. border: 1px solid black;
    22. background: purple;
    23. width: 16px;
    24. subcontrol-position: left;
    25. subcontrol-origin: margin;
    26. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images

  2. Join Date
    Feb 2006
    Location
    Tampere, Finland
    Posts
    6,251
    Thanks
    36
    Thanked 1,422 Times in 1,354 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Re: Scrollbar background does not go solid (?) when using stylesheets

    What if you preview it in a different style, like plastique?
    J-P Nurmi

  3. Join Date
    Feb 2008
    Posts
    26
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Re: Scrollbar background does not go solid (?) when using stylesheets

    Interesting! I didn't test all styles because I assumed they would all give the same results after I tried a few, but it appears that both the Motif and CDE styles are the only styles with correct and solid colored backgrounds for the scrollbar. The rest don't (Windows, Windows XP, Windows Vista, Cleanlooks, Plastique, ..)

    I guess we're looking at a bug here?
    (I'm using the snapshot from March 19th, by the way)
    Last edited by Stukfruit; 19th March 2008 at 22:35.

  4. Join Date
    Feb 2006
    Location
    Tampere, Finland
    Posts
    6,251
    Thanks
    36
    Thanked 1,422 Times in 1,354 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Re: Scrollbar background does not go solid (?) when using stylesheets

    Quote Originally Posted by Stukfruit View Post
    I guess we're looking at a bug here?
    (I'm using the snapshot from March 19th, by the way)
    I guess so, I suggest you send your findings at Qt4-preview-feedback Mailing List.
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    Stukfruit (20th March 2008)

+ Reply to Thread

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