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. Qt widen QScrollBar when hover using StyleSheet

Qt widen QScrollBar when hover using StyleSheet

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.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.
  • W Offline
    W Offline
    Wahsekim
    wrote on last edited by
    #1

    I'm trying to change the width of a vertical QScrollBar with a custom stylesheet like
    @QScrollBar:vertical
    {
    border: 2px solid grey;
    background: #32CC99;
    width: 10px;
    margin: 22px 0 22px 0;
    }
    QScrollBar:vertical:hover {
    background: red;
    width: 25px ;
    }@

    It doesn't work. Did I make any mistake? Can't we change the width of widget in run-time?

    1 Reply Last reply
    0
    • W Offline
      W Offline
      Wahsekim
      wrote on last edited by
      #2

      I have the solution. I sub classed QScrollBar and set the style sheet in enterEvent and leaveEvent. It works fine for me.

      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