Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

progress bar showing both "written" and "read" ?



  • a progress bar may be thought of as showing how much data is written, say to a disk. but what if that same progress bar could also show how much data is being read from what was written? in this case if the reader catches up to the writer, the "Bar" would appear one pixel wide, but let's assume the reader is slower than the writer.

    so you'd see the bar "fill up" quickly, with color, left to right, but then be slowly eaten away with white, left to right. does that make sense?

    is this possible to accomplish using QProgressBar or by overriding it? without re-implementing the entire paint functionality.

    note i'm using styled drawing not platform drawing, so there is more flexibility.

    here's what i have:
    now.png

    here's what i want:
    want.png

    the left edge is being eaten even as the right edge is extending. see?



  • i was able to do it by overriding paint, calling inherited, then just erasing the start area



  • Why not two progress bars, horizontal one on top of the other?
    If you feel like it you could make a single widget displaying two progress bars (and accepting two values to mark progress).
    Above all - why QScrollBar and not QProgressBar?



  • sorry, i originally wrote QScrollBar but meant to write QProgressBar. The spec calls for one bar, not two, so i'm following the spec, and can't change it. also, vertical space is at a premium. so: can i do this? i'm attempting to override the paint event to erase part of it.



  • i was able to do it by overriding paint, calling inherited, then just erasing the start area


Log in to reply