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
Forum Updated to NodeBB v4.3 + New Features

QProgressBar Gradient Vertical QT5

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.2k 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.
  • J Offline
    J Offline
    JPannetier
    wrote on 25 Feb 2017, 09:42 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 ```

    M 1 Reply Last reply 25 Feb 2017, 10:21
    0
    • J JPannetier
      25 Feb 2017, 09:42

      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 ```

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 25 Feb 2017, 10:21 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 26 Feb 2017, 11:11 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

        M 1 Reply Last reply 26 Feb 2017, 11:13
        0
        • J JPannetier
          26 Feb 2017, 11:11

          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

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 26 Feb 2017, 11:13 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

          1/4

          25 Feb 2017, 09:42

          • Login

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