QProgressbar Range more than int type
-
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 -
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@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
intrange!QScrollbarwon't have > 4,000,000,000 "notches" :) -
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@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 ticksomething like that
-
@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
intrange!QScrollbarwon't have > 4,000,000,000 "notches" :)@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 :( -
@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 ticksomething like that
@J-Hilk thanks for your reply. I see, let me dig around a bit on creating sub-progress
-
@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 :(@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
QProgressbarbut you talk aboutQScrollBar.]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.
-
@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
QProgressbarbut you talk aboutQScrollBar.]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-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-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! :) -
@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)
@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!
QProgressbargiving you anintrange 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.]
