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
Forum Update on Monday, May 27th 2025

QProgressBar Chunk

Scheduled Pinned Locked Moved General and Desktop
10 Posts 4 Posters 16.6k 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.
  • G Offline
    G Offline
    goocreations
    wrote on last edited by
    #1

    I've tried google for this, but I'm not sure what to search for.

    I'm looking for a way to change a QProgressBar so that only a chunk with a fixed size is moving. That is, the progress bar is not filling up from one side to another, but that only a chunk/part is moving from one side to another. (If the progress bar is 100px, I only want a 10px chunk moving from left to right).

    I think I saw something like this in KDE.

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

      Hi,

      look at the class documentation: "QProgressBar":http://doc.qt.nokia.com/4.7/qprogressbar.html
      It's a bit tricky, but set minimum = 0, maximum=0, value=-1.On windows, that works ...

      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
      • G Offline
        G Offline
        goocreations
        wrote on last edited by
        #3

        Wow, thats cool. Is there anyway to change the size of the chunk or the speed of movement?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Only in the style, I think.

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

            Could be that it only works on windows with windows style. And I think, if you use style sheets, it does not work anymore, especially in 4.5, there we triesd that with a style sheet. Whether that is fixed in 4.7 I don't know...

            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
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              I tried it with differen styles (modife, CDE, plastique, cleanlooks, windows, windows XP, windows vista) and it worked in all.
              And I tried to style it, it is also possible:

              @
              QProgressBar::chunk {
              background-color: #05B8CC;
              width: 20px;
              }
              @
              used as style sheet. See "Styling the progress bar":http://doc.qt.nokia.com/4.6/stylesheet-examples.html#customizing-qprogressbar

              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
              • G Offline
                G Offline
                goocreations
                wrote on last edited by
                #7

                Thank you very much for your help

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jdbastardy
                  wrote on last edited by
                  #8

                  Looks like there is not a way to make the QProgressBar in maquee style (I think it what goocreations mean).

                  !http://www.devexpress.com/Subscriptions/DXperience/WhatsNew2010v1/i/wpf-progress-bar.png(Marquee)!

                  Is it the second bar you'd like to use?

                  http://mattias-cibien.co.cc

                  • Prepare for Qt consequences.
                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goocreations
                    wrote on last edited by
                    #9

                    Yip, exactly that bar is what I need (2nd one)

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jdbastardy
                      wrote on last edited by
                      #10

                      It is a marquee bar.

                      From Qt Documentarion:

                      bq. If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using QFtp or QNetworkAccessManager to download items when they are unable to determine the size of the item being downloaded.

                      Tested and working

                      http://mattias-cibien.co.cc

                      • Prepare for Qt consequences.
                      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