Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue with Animating Progress Bar?

Issue with Animating Progress Bar?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 794 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    Omni_Philm
    wrote on last edited by
    #1

    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();
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you modify the easing curve of your QPropertyAnimation ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      O 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Did you modify the easing curve of your QPropertyAnimation ?

        O Offline
        O Offline
        Omni_Philm
        wrote on last edited by
        #3

        @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?

        1 Reply Last reply
        0
        • O Offline
          O Offline
          Omni_Philm
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • O Offline
            O Offline
            Omni_Philm
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved