PDA

View Full Version : Progress bar with multiple "values groups" ?



rsilva
13th May 2011, 04:18
I want to make a progressbar that can display multiple "groups of values".

Example:
If have a group that 0% to 10% is not "filled".
A group from 10% to 50% is "filled".
A group from 50% to 70% is not "filled".
The last group from 70% to 100% "filled".

Or something like this image:
http://i56.tinypic.com/2qnmxc6.jpg

I think I'll need to subclass the QProgressBar but, how I can do this ?
PaintEvent ? How to have the same "fill pattern" of the progress bar ?

ChrisW67
13th May 2011, 06:58
Have you considered putting several QProgressBars in a horizontal layout with no margins and style away the border on the bars?

SixDegrees
13th May 2011, 08:44
Another question: let's say section 1 has completed some portion of its work, while section 2 has completed none. How is the user supposed to know what proportion of section 1 is complete? The only way to know the extent of a section is if the following section's beginning is marked by some portion of that section being completed.

This does not seem like a sound approach to informing the user of what's going on.

ChrisW67
13th May 2011, 09:12
Or if section 1 is complete and section 2 is partially complete: is section 1 at 25%, 100% or 150%. What about section 2?

rsilva
13th May 2011, 14:22
There's not "multiple-sections", and the user will select from X to Y values.
So if the user is who select the progress that you go from 0% to 30%, this section will be "filled".
And later he can select the progress only of 70% to 100% if he wants, and so, the progress will go, and "fill" the progress bar as the function work.
And I can't use multiple progressbar because the user will select the values, and can have any "section" number.
And the sizes may vary too, using multiple scrollbars I think it's possible to do some tricks, but, too much work and will be better showing more than 1 "section" instead of more than 1 progressbar.

Since I'll don't show "multiple works progresses" if "section" 2 is complete:
If the user have used 2 "sections". They will be a fixed size (depending on the two sections size and the percent of each one).



section 1 section 2
[ ][ ]
will be like this:
[ ##### ]
[ ################# ]
[ ################################] (section 2 complete)


And I want to add a "marker" too:


[ ################################] (section 2 complete)
/\ /\ /\


Before starting the progress, the user can split or change some sections.
And so "start" the work on that section.
If he pause he can add or change some sections.

SixDegrees
13th May 2011, 16:44
It sounds even more as though multiple progress bars are the answer. They seem to address and solve every point you've mentioned.

In any case, there is no way to do what you're asking in a single progress bar without rewriting the entire class nearly from scratch, a significantly larger coding effort than simply stringing several normal bars together end-to-end and wrapping them in a simple interface.

rsilva
14th May 2011, 00:06
I understand. I will try to do this and for the sizes will do some percent calcs ^^