Results 1 to 3 of 3

Thread: Setting a transparent background to QScrollbar using stylesheets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Posts
    17
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Setting a transparent background to QScrollbar using stylesheets

    Hi,

    I am currently trying to set a scrollbar with completely transparent background.

    It works well for the part under the handler, which is completely transparent, but in the part where the handler is not, some kind of white canvas remains...

    See a picture in the attachment.

    Here's the stylesheet I use for Scrollbars:

    Qt Code:
    1. QScrollBar:vertical {
    2. background: transparent;
    3. width: 19px;
    4. padding: 0 0 20px 0;
    5. margin: 20px 0 20px 0;
    6. }
    7. QScrollBar::handle:vertical {
    8. background: transparent;
    9. border-image: url(scrollbar.png) 4 0 4 0 repeat;
    10. border-top: 4px;
    11. border-bottom: 4px;
    12. min-height: 39px;
    13. }
    14. QScrollBar::add-line:vertical {
    15. border-top: solid 5px transparent;
    16. background: none;
    17. height: 20px;
    18. subcontrol-position: bottom;
    19. subcontrol-origin: padding;
    20. }
    21. QScrollBar::sub-line:vertical {
    22. border: none;
    23. background: none;
    24. height: 20px;
    25. subcontrol-position: top;
    26. subcontrol-origin: margin;
    27. }
    28. QScrollBar::up-arrow:vertical{
    29. image: url(uparrow.png);
    30. }
    31. QScrollBar::down-arrow:vertical{
    32. image: url(downarrow.png);
    33. }
    To copy to clipboard, switch view to plain text mode 

    Any idea ?

    Thanks a lot.
    Márwyn
    Attached Images Attached Images

Similar Threads

  1. Problem: Transparent Background with Stylesheets
    By dropkickz in forum Qt Programming
    Replies: 2
    Last Post: 7th June 2011, 10:58
  2. Qt Widgets seen half transparent when using stylesheets
    By codeslicer in forum Qt Programming
    Replies: 5
    Last Post: 14th December 2010, 09:52
  3. Transparent QScrollbar groove in QWebView
    By Jonas in forum Qt Programming
    Replies: 0
    Last Post: 20th October 2008, 08:55
  4. QScrollbar Stylesheets problems in Qt4.4
    By GuS in forum Qt Programming
    Replies: 2
    Last Post: 6th September 2008, 20:37
  5. Transparent background on QLabel on transparent QWidget
    By codeslicer in forum Qt Programming
    Replies: 1
    Last Post: 13th February 2008, 02:10

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