Hi,
Is there any kind of Progress Bar that accepts "double" or "float" values ?
Thanks,
Hi,
Is there any kind of Progress Bar that accepts "double" or "float" values ?
Thanks,
Òscar Llarch i Galán
Actually there isn't any. But of course you could inherit current QProgressBar to take double values. But you need to simulate changing double values to integers at the background. I mean assume that you want to setProgress to 13,12 so you could do this by using 13,12 as 1312 then apply it internally to setProgress(int) function. This sound wierd but it works.
Hi,
Ok, thanks for your replies. Will try it.
Òscar Llarch i Galán
This makes no sense if you think about it, since floating point has no boundries, which means you can't know when to move the progress bar to the next value.Is there any kind of Progress Bar that accepts "double" or "float" values ?
I am sure if you will explain your task to us, we can show you how to do it with the normal progress bar.
The most likely slution is just to mutiply the the float untill it becomes integer, simialr to what hayati suggested.
Hi,
Why not? I want to use the QProgressBar as a percent indicator. I have an integer counting "good" values and another counting "bad" values. I want to know which % are the good values respect the total values.This makes no sense if you think about it
So, I want to use the QProgressBar to represent it in a graphical way.
Òscar Llarch i Galán
yes ofcourse you may have,
but as you said you want to use percentage.
it doesn't make any change between %33,33 and %33 actually, but if it's requirement of course you should.
in your case percentage could be boundary (upper and lower limits of numbers is certain).
so you simply multiply the numbers with 100 then when you can display what you want to display either %33,33 or %33.
but in this case you need to inherit.
Hi,
Ok, thanks for your reply.
I think that I will hide the text of progress bar and insert a QLabel that will display the value with floating point.
Thanks,
Last edited by ^NyAw^; 23rd March 2007 at 15:31.
Òscar Llarch i Galán
Because there is no "next number" from 0.2 to 0.3. (for example)Why not?
Unless you can say what it is.
Then all you need is to decide on the percent resolution, and mutiply acourdigly.I want to use the QProgressBar as a percent indicator. I have an integer counting "good" values and another counting "bad" values. I want to know which % are the good values respect the total values.
Then you have ints, and you can use the progress bar normaly.
Bookmarks