[SOLVED]QProgressBar stylesheet problem
-
Hi,
I styling my ProgressBarI customize progress percent image.
But... i have problem with one... 50% - Qt Creator show good, 50% in App show 100%... i don't know why
Stylesheet:
@QProgressBar#progressBar
{
border:0;
background-color:rgb(0,0,0);
}QProgressBar#progressBar::chunk:horizontal
{
background-image:url(:/img/barV2);
width:1px;
}@Image:
!http://www.sdilej.eu/pics/6f4e71defd6125a232bc6d1a8e8df930.png(Image)!Top: App
Bot: Qt creator -
The size of the progressbar is not connected to the way you want to display it. The stylesheet only changes the way it is displayed.
The % completed size is determined by two properties: Maximum and Value (minimum also, but we will assume you have 0 as minimum).
You might want to try and set the:
@
QProgressBar::setMaximum(Your max percentage here); // Might be in constructor?
.....
QProgressBar::setValue(current persentage here);
@ -
[quote author="glararan" date="1336503116"]I add it to code...nothing changed
EDIT:SOLVED[/quote]
Hi,
You need to EDIT your first post and append SOLVED if you got the answer. If not then you can provide your code so that we can figure out the above behavior of the progress bar. As it has already been explained above that stylesheets mostly deals with the look and feel of the component.Thanks :)