How to stop an animation when a new one starts c++
-
Hello, I have a problem. I have a progressbar connected with timeline animation. Always when I press enter the timeline should restart, but instead the old animation is running until its finished. And the new animation, which was created when i pressed enter is also running from start. I want that everytime I press enter the timeline starts new and the old one should stop. Is that possible? I try to solve this for days...
-
@MEsc Why do you create new animation every time you press enter? Just reuse the existing animation: stop it if it is running (https://doc.qt.io/qt-5/qabstractanimation.html#stop) and start it again (https://doc.qt.io/qt-5/qabstractanimation.html#start).
-
@MEsc said in How to stop an animation when a new one starts c++:
I only want to stop the animation when QLineEdit is not empty
Then do so, what is the problem?
-
@MEsc said in How to stop an animation when a new one starts c++:
It should first check if QLineEdit is empty and if not then stop the animation(
So change the order - I mean you're the programmer who programmed it so first checking for the QLineEdit and then doing something other shouldn't be that hard to add.