Results 1 to 7 of 7

Thread: Progress bar with multiple "values groups" ?

  1. #1
    Join Date
    Apr 2011
    Posts
    61
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Progress bar with multiple "values groups" ?

    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:


    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 ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Progress bar with multiple "values groups" ?

    Have you considered putting several QProgressBars in a horizontal layout with no margins and style away the border on the bars?

  3. #3
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Progress bar with multiple "values groups" ?

    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.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Progress bar with multiple "values groups" ?

    Or if section 1 is complete and section 2 is partially complete: is section 1 at 25%, 100% or 150%. What about section 2?

  5. #5
    Join Date
    Apr 2011
    Posts
    61
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Progress bar with multiple "values groups" ?

    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).

    Qt Code:
    1. section 1 section 2
    2. [ ][ ]
    3. will be like this:
    4. [ ##### ]
    5. [ ################# ]
    6. [ ################################] (section 2 complete)
    To copy to clipboard, switch view to plain text mode 

    And I want to add a "marker" too:
    Qt Code:
    1. [ ################################] (section 2 complete)
    2. /\ /\ /\
    To copy to clipboard, switch view to plain text mode 

    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.
    Last edited by rsilva; 13th May 2011 at 13:28.

  6. #6
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Progress bar with multiple "values groups" ?

    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.

  7. #7
    Join Date
    Apr 2011
    Posts
    61
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Progress bar with multiple "values groups" ?

    I understand. I will try to do this and for the sizes will do some percent calcs ^^

Similar Threads

  1. Replies: 14
    Last Post: 16th May 2017, 03:51
  2. QSettings to save multiple "workspaces"
    By Bitruder in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2009, 21:56
  3. Replies: 4
    Last Post: 11th March 2008, 11:44
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. Progress of SQL "select"
    By brokensword in forum Qt Programming
    Replies: 9
    Last Post: 16th January 2008, 15:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.