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. QStyle:Lineargradient
Qt 6.11 is out! See what's new in the release blog

QStyle:Lineargradient

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.7k 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1

    I want green to red lineargradient, but it separate into parts.

    QProgressBar{background-color: #FFFFFF;}
    QProgressBar::chunk{height: 20px; background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0,255, 0, 255), stop:1 rgba(255,0,0, 255));}

    alt text

    https://github.com/sonichy

    sonichyS 1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      Can you give more details on the requirement. Question was not very clear to me.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      1 Reply Last reply
      2
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        You can use the build in editor
        Right click, change stylesheet -> Gradient -> edit
        alt text

        1 Reply Last reply
        2
        • sonichyS sonichy

          I want green to red lineargradient, but it separate into parts.

          QProgressBar{background-color: #FFFFFF;}
          QProgressBar::chunk{height: 20px; background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0,255, 0, 255), stop:1 rgba(255,0,0, 255));}

          alt text

          sonichyS Offline
          sonichyS Offline
          sonichy
          wrote on last edited by
          #4

          @sonichy Delete the "height: 20px;" solve the problem !

          https://github.com/sonichy

          1 Reply Last reply
          1

          • Login

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