PDA

View Full Version : progress bar look like battery



bibhukalyana
15th June 2011, 12:27
Hi everyone,
I want to create a battery icon and where i can show the battery percentage.So i want to change the style sheet of progress bar so that it looks like a battery.
Can any one help me how to create a style sheet for progress bar so that it looks like a battery
or is there any better way for this one ?

thanks.

wysota
15th June 2011, 15:40
I think it's easier to subclass QProgressBar and implement what you want there.

bibhukalyana
16th June 2011, 07:32
Do you have any example which will help me ?

wysota
16th June 2011, 09:55
There are lots of examples available. You can have a look at the Analog Clock example in the docs.

Santosh Reddy
16th June 2011, 10:14
Dis you try this from documentation (http://doc.qt.nokia.com/4.7/stylesheet-examples.html#customizing-qprogressbar)


QProgressBar::chunk {
background-color: #CD96CD;
width: 10px;
margin: 0.5px;
}