What library should I use for animation in Qt Widgets Application?
-
I have to do a simple pipeline simulator for a university course programming project. And I want to simulate water level increasing on a tank. That's not on the course's content and I've been looking for tutorials but it doesn't seem to be much about the animation topic, at least not about this simple interactive type I want to do.
My idea is to have a widget with the image of the tank, and in front of that to show the animation of the water level increasing depending of the speed of the water entering the tank.
What libraries should I use for doing this in a widget application? Can animations be done with QPainter, Bitmap, etc? Any books you recommend? Any tutorials? Thank you.
-
Hi and welcome to devnet,
Two solutions comes to mind:
See the QML Book for a good starting point on the later.
Depending on how you want to do your animation, QtQuick is likely what you want to go after.
-
@ricardovaras_99 said in What library should I use for animation in Qt Widgets Application?:
And I want to simulate water level increasing on a tank.
Do you want to animate the water level (in other words, make the level rise or fall at a specific speed in real time)? Or do you just want to display the water level? (in other words, make the picture show the latest level)?
If you want the latter, have a look at the Qt Quick Coffee Machine demo: