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

Issue with Animating Progress Bar?



  • Hello all,

    I have this issue where the animation of the progress bar does not complete.

    I am animating the movement of the progress bar when the value changes.

    For example, I animate the value change from 0 to 25. In actuality, the bar moves from 0 to 20%. Then, when a repaint occurs, the value jumps up to the desired 25%.

    Has anyone else ran into this issue?

    Setting up the progress bar:

    ui->progressBar->setTextVisible(false);
    ui->progressBar->setRange(0, 100);
     p_ProgressBar1Animation = new QPropertyAnimation(ui->progressBar, "value");
    

    Code that is ran in order to animate the value:

    void MainWindowController::changeProgressBar_1Value(int value)
    {
        int someValue = 0;
    
        if(value == 0)
            someValue = 0;
        else if(value < MIN_PROGRESS_BAR_VALUE)
            someValue = MIN_PROGRESS_BAR_VALUE;
        else
            someValue = value;
    
        p_ProgressBar1Animation->setDuration(PROGRESS_BAR_ANIMATION_DURATION_MS);
        p_ProgressBar1Animation->setStartValue(ui->progressBar->value());
        p_ProgressBar1Animation->setEndValue(someValue);
        p_ProgressBar1Animation->start();
    }
    

  • Lifetime Qt Champion

    Hi,

    Did you modify the easing curve of your QPropertyAnimation ?



  • @SGaist
    The easing curve? I am going to go with no on that since I am not sure what that is. But who knows, maybe I ended up editing it without realizing it. Where do I go to check that value?



  • Yeah so I am playing around with the easing function and the "bug" is not going away



  • This post is deleted!

Log in to reply