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. Simple question about QProgressBar
Qt 6.11 is out! See what's new in the release blog

Simple question about QProgressBar

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 1.8k Views 2 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.
  • GofferG Offline
    GofferG Offline
    Goffer
    wrote on last edited by A Former User
    #1

    Hi community

    stupid question today ...
    When you have the maximumValue and value at 0. the bar is animated, how can I simply make it display 0% in this case ? instead of having this animation.

    Thx

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      myProgressBar->setRange(0, 100);
      myProgressBar->setValue(0);
      

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      GofferG 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        myProgressBar->setRange(0, 100);
        myProgressBar->setValue(0);
        
        GofferG Offline
        GofferG Offline
        Goffer
        wrote on last edited by
        #3

        @SGaist
        That s not what i want.
        When I create it the range is 0.0 because there is nothing and then when i add and object I will increment the maximum range. because the percentage is calculated based on a given number of objects and not 100 units

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          That was just an example, if you don't want the animation you need a range, whether it's 0-1 or 0-20000 is not important.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • GofferG Offline
            GofferG Offline
            Goffer
            wrote on last edited by
            #5

            Okay, so I might have to trick at the first iteration as It will be already set to 1 ...
            Thx

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Or let the animation run while you don't have yet a value to set

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • GofferG Offline
                GofferG Offline
                Goffer
                wrote on last edited by
                #7

                It looks very annoying with the animation ...

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  I know that some things don't follow our personal tastes but you must also think about your application users and what they are expecting.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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