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 Range more than int type
Forum Updated to NodeBB v4.3 + New Features

QProgressbar Range more than int type

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 989 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.
  • HrishiGoblerH Offline
    HrishiGoblerH Offline
    HrishiGobler
    wrote on last edited by
    #1

    Hey there,
    I have a situation where I need to support scroll with value bigger than integer type, but the QScrollBar supports maximum value of "int" type only.
    Any standard workaround for this or any suggestion?
    Thanks in advance

    JonBJ J.HilkJ 2 Replies Last reply
    0
    • HrishiGoblerH HrishiGobler

      Hey there,
      I have a situation where I need to support scroll with value bigger than integer type, but the QScrollBar supports maximum value of "int" type only.
      Any standard workaround for this or any suggestion?
      Thanks in advance

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @HrishiGobler
      Umm, really? The range of an (unsigned) int is up to about 4 billion, how can you possibly need a scroll with bigger range than that??

      Anyway, if you have, say, a 64-bit or a double for your data, use division to reduce it to an int range! QScrollbar won't have > 4,000,000,000 "notches" :)

      HrishiGoblerH 1 Reply Last reply
      3
      • HrishiGoblerH HrishiGobler

        Hey there,
        I have a situation where I need to support scroll with value bigger than integer type, but the QScrollBar supports maximum value of "int" type only.
        Any standard workaround for this or any suggestion?
        Thanks in advance

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @HrishiGobler your range is bigger than 0 to 2,147,483,647 ? oO

        I know of no easy workaround, and in my opinion, you should rethink your approach.
        You could make multiple progress bar ( subporgess and overall progress) or only update every 5th progress tick

        something like that


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        HrishiGoblerH 1 Reply Last reply
        3
        • JonBJ JonB

          @HrishiGobler
          Umm, really? The range of an (unsigned) int is up to about 4 billion, how can you possibly need a scroll with bigger range than that??

          Anyway, if you have, say, a 64-bit or a double for your data, use division to reduce it to an int range! QScrollbar won't have > 4,000,000,000 "notches" :)

          HrishiGoblerH Offline
          HrishiGoblerH Offline
          HrishiGobler
          wrote on last edited by
          #4

          @JonB thanks for your reply.
          ( Qt supports int which is 2 billion, but I would be happy if I can get atmost scroll of unsigned-int.)
          Sure, the division is a good strategy but than pressing a single scroll would take my view up/down to to 2 scroll :(

          JonBJ 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @HrishiGobler your range is bigger than 0 to 2,147,483,647 ? oO

            I know of no easy workaround, and in my opinion, you should rethink your approach.
            You could make multiple progress bar ( subporgess and overall progress) or only update every 5th progress tick

            something like that

            HrishiGoblerH Offline
            HrishiGoblerH Offline
            HrishiGobler
            wrote on last edited by
            #5

            @J-Hilk thanks for your reply. I see, let me dig around a bit on creating sub-progress

            1 Reply Last reply
            1
            • HrishiGoblerH HrishiGobler

              @JonB thanks for your reply.
              ( Qt supports int which is 2 billion, but I would be happy if I can get atmost scroll of unsigned-int.)
              Sure, the division is a good strategy but than pressing a single scroll would take my view up/down to to 2 scroll :(

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @HrishiGobler said in QProgressbar Range more than int type:

              Sure, the division is a good strategy but than pressing a single scroll would take my view up/down to to 2 scroll :(

              I have no idea what you are thinking of. In the example that would still mean the user has 1 billion "steps" to go through on the scroll. If you have a scroller with even a fraction of that numbers of steps something is crazy in your interface.

              [EDIT OK, sorry, realized progress bar, not scroll bar! Actually your title says QProgressbar but you talk about QScrollBar.]

              Also, even if you have a "sub-progress" it's pointless if you have ~ > 1 billion steps. I don't understand what your situation is or what @J-Hilk is thinking of suggesting a sub-progress in this situation. Whether scroll bar or progress bar.

              J.HilkJ 1 Reply Last reply
              1
              • JonBJ JonB

                @HrishiGobler said in QProgressbar Range more than int type:

                Sure, the division is a good strategy but than pressing a single scroll would take my view up/down to to 2 scroll :(

                I have no idea what you are thinking of. In the example that would still mean the user has 1 billion "steps" to go through on the scroll. If you have a scroller with even a fraction of that numbers of steps something is crazy in your interface.

                [EDIT OK, sorry, realized progress bar, not scroll bar! Actually your title says QProgressbar but you talk about QScrollBar.]

                Also, even if you have a "sub-progress" it's pointless if you have ~ > 1 billion steps. I don't understand what your situation is or what @J-Hilk is thinking of suggesting a sub-progress in this situation. Whether scroll bar or progress bar.

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @JonB I was thinking
                alt text

                As I assumed we're talking about Progress and not Scrollbar


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                JonBJ 1 Reply Last reply
                0
                • J.HilkJ J.Hilk

                  @JonB I was thinking
                  alt text

                  As I assumed we're talking about Progress and not Scrollbar

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #8

                  @J-Hilk
                  Hi. I know you were! BUT.

                  You could make multiple progress bar ( subporgess and overall progress) or only update every 5th progress tick

                  "Every 5th tick" would mean that something (the lower one?) only increments every 5th tick. So instead of 2 billion "notches" it will have 400 million to go through. Do you think it has 400M "notches" for the user to see? How long is the operation going to take? And so on.

                  There is nothing wrong with paired-progresses like this in itself. There is everything wrong with trying to represent numbers > 2 billion in a progress/scroll bar, without using division.

                  BTW: There are about, what, 40 segments in these bars? So for the record there is no point having a range > 40 (or, say, > 100-ish even if the representation is smooth/continuous) in a progress bar. So you might as well divide range to, say, 0--100 in any case, and not worry about the size of an int! :)

                  J.HilkJ 1 Reply Last reply
                  1
                  • JonBJ JonB

                    @J-Hilk
                    Hi. I know you were! BUT.

                    You could make multiple progress bar ( subporgess and overall progress) or only update every 5th progress tick

                    "Every 5th tick" would mean that something (the lower one?) only increments every 5th tick. So instead of 2 billion "notches" it will have 400 million to go through. Do you think it has 400M "notches" for the user to see? How long is the operation going to take? And so on.

                    There is nothing wrong with paired-progresses like this in itself. There is everything wrong with trying to represent numbers > 2 billion in a progress/scroll bar, without using division.

                    BTW: There are about, what, 40 segments in these bars? So for the record there is no point having a range > 40 (or, say, > 100-ish even if the representation is smooth/continuous) in a progress bar. So you might as well divide range to, say, 0--100 in any case, and not worry about the size of an int! :)

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by
                    #9

                    @JonB afaik the "ticks" if you mean the progress bar chunks, are not directly related to the range of the progress bar. They should be fix ( linked to the size of the Progressbar on the screen)


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    JonBJ 1 Reply Last reply
                    0
                    • J.HilkJ J.Hilk

                      @JonB afaik the "ticks" if you mean the progress bar chunks, are not directly related to the range of the progress bar. They should be fix ( linked to the size of the Progressbar on the screen)

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by JonB
                      #10

                      @J-Hilk
                      See the BTW I just added. Any range much bigger than 100-ish is not worth having for a progress bar. So don't sweat the small stuff on big integer ranges when you/the OP has this arithmetic operation called "division" :)

                      [Even with, say, 2 progress bars at 100 visible "notches" each that's still only 10,000 "steps" for the user to see. Nowhere near > 2 billion! QProgressbar giving you an int range instead of just, say fixed 0-100 is just a minor convenience: it still does division of the range -> notches, just saves you doing so.]

                      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