Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]How can I style QScrollArea scrollbars
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]How can I style QScrollArea scrollbars

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 7.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mbnoimi
    wrote on last edited by
    #1

    How can I style QScrollArea scrollbars using qss?

    I tried to use the following but it didn't work!
    [code]#scrollArea_main QScrollBar:horizontal {
    border: 2px solid grey;
    background: #32CC99;
    height: 15px;
    margin: 0px 20px 0 20px;
    }
    #scrollArea_main QScrollBar::handle:horizontal {
    background: white;
    min-width: 20px;
    }
    #scrollArea_main QScrollBar::add-line:horizontal {
    border: 2px solid grey;
    background: #32CC99;
    width: 20px;
    subcontrol-position: right;
    subcontrol-origin: margin;
    }
    #scrollArea_main QScrollBar::sub-line:horizontal {
    border: 2px solid grey;
    background: #32CC99;
    width: 20px;
    subcontrol-position: left;
    subcontrol-origin: margin;
    }[/code]

    P.S. I'm using Qt 5.2.1 with Mint x64 and Windows 7 32bit

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Hi,

      Can you show he code where you use the stylesheet.

      Did you try it outin Qt Creator? That's a good place to play around with stylesheets and avoid typos.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbnoimi
        wrote on last edited by
        #3

        Thank you guys, I found out this solution from "QDarkStyleSheet":https://github.com/ColinDuquesnoy/QDarkStyleSheet qss

        P.S. I added it to "CSSBased style wiki page":http://qt-project.org/wiki/Style-CSSBased

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved