PDA

View Full Version : QProgressbar text format



jothy
9th June 2010, 11:44
Hi all, I want to set the format of QProgressBar to double. How to do this . Documentation says setFormat can be used to do this.

But I don't know exactly how to do this. Any help will be greatly appreciated.

I am a python guy, if someone can tell me in python, it will be more useful.

Thanks,

Jothy

Ginsengelf
9th June 2010, 12:39
Hi, the setFormat() method only changes the way the progress is displayed. It does not change the class internally so it will still use int as datatype.

Ginsengelf

jothy
9th June 2010, 18:31
Then, how to change this?

Thanks,

Jothy

pastispast
4th August 2010, 18:02
I think one solution can be take the value in the multiple of 10 or 100, for example:

if you want to give value as 45.46 then set the range for QProgressBar to (0 to 10000) and then multiply value 45.46 with 100 and then give it to set value.



pbar.setRange(0, 10000);
pbar.setValue(4546);