Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QProgressBar chunk

    General and Desktop
    4
    5
    4428
    Loading More Posts
    • 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
      stima_ua last edited by

      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 Reply Quote 0
      • B
        bergo.torino last edited by

        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 Reply Quote 0
        • S
          stima_ua last edited by

          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 Reply Quote 0
          • G
            giesbert last edited by

            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 Reply Quote 0
            • V
              veeeee_d last edited by

              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 Reply Quote 0
              • First post
                Last post