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. QProgressBar Gradient Vertical QT5
QtWS25 Last Chance

QProgressBar Gradient Vertical QT5

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.1k Views
  • 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.
  • J Offline
    J Offline
    JPannetier
    wrote on last edited by
    #1

    Hello,

    I'm using QT5.
    I found to use a gradient on a horizontal progressbar.
    Nevertheless , my progressbar is vertical :

    QProgressBar::chunk {
    background-color: #18FF00;
    height:10px;
    margin: 0.5px;
    }

    alt text

    I wish to have green 0->40
    orange 40->70
    red 70-100 ```

    mrjjM 1 Reply Last reply
    0
    • J JPannetier

      Hello,

      I'm using QT5.
      I found to use a gradient on a horizontal progressbar.
      Nevertheless , my progressbar is vertical :

      QProgressBar::chunk {
      background-color: #18FF00;
      height:10px;
      margin: 0.5px;
      }

      alt text

      I wish to have green 0->40
      orange 40->70
      red 70-100 ```

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @JPannetier

      Hi
      If you right click your QProgressBar and select CHange Style Sheet

      There is a gradient editor that can make it easy to alter the direction

      alt text

      1 Reply Last reply
      2
      • J Offline
        J Offline
        JPannetier
        wrote on last edited by
        #3

        Thank you Mrjj ,
        Nertheless, the gradient doesn't work if i create little margin

        height:10px;
        margin: 0.5px;
        It create this :
        alt text

        I wish this :

        alt text

        mrjjM 1 Reply Last reply
        0
        • J JPannetier

          Thank you Mrjj ,
          Nertheless, the gradient doesn't work if i create little margin

          height:10px;
          margin: 0.5px;
          It create this :
          alt text

          I wish this :

          alt text

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @JPannetier
          Well its most likely related to the actual QProgressBar and not
          the stylesheet.
          Try with a plain widget and see how that works, for test.

          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