Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Indefinite QProgressBar with only left to right, left to right , left to right



  • Hi,

    How to implements a indefinite QProgressBar with chunk moving only in one direction (left to right, after reaching end, agin left to right?

    Thanks,



  • You can turn QProgessBar into a busy-indicator by setting both minimum and maximum to zero. The actual appearance is platform-dependent.


  • Moderators

    @Wieland
    i guess thats what he is already doing. He just wants the appearance to be different.

    @inforathinam
    the problem is that there is no easy way to do so.
    You can play around with QStyle's subelements to paint a progressbar of your desire.

    Use the sub elements

    • QStyle::SE_ProgressBarGroove
    • QStyle::SE_ProgressBarContents
    • QStyle::SE_ProgressBarLabel
    • QStyle::SE_ProgressBarLayoutItem

    for painting.

    For the painting of QStyle::SE_ProgressBarContents try to translate from left to right the painter and also set a clipping rect for it.
    You will have to do the animation also by yourself


Log in to reply