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

QProgressBar chunk

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 5.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.
  • S Offline
    S Offline
    stima_ua
    wrote on last edited by
    #1

    can i set first(value = 0) and last(value=100) chunk image in progressbar?

    something like this:

    @
    QProgressBar::chunk:first {
    /**/
    }
    @

    ??

    [EDIT: code formatting, please wrap in @-tags, Volker]

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bergo.torino
      wrote on last edited by
      #2

      Hello,

      in QWidget world you can use setRange(min,max) slot to achieve this. In case of QML desktop components you can use minimumValue and maximumValue properties.

      Cheers

      ps: QML related questions should be asked in QtQuick subcategory of this forum.

      It's compiling - mostly I'm slacking off ;)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stima_ua
        wrote on last edited by
        #3

        hm..

        It's QProgressbar stylesheet

        @QProgressBar::chunk { background: red }@ -- set all chunk red

        I need set first and last chunk different ... i try:
        @QProgressBar::chunk:first { background: green }
        QProgressBar::chunk:last { background: blue }@

        but it does not work

        how can i do this

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          AFAIK, this is not possible.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • V Offline
            V Offline
            veeeee_d
            wrote on last edited by
            #5

            I'll double it as not possible, I believe. You could add your own signal handler to change the progress bar style sheet when it is completed with a regular call to setStyleSheet.

            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