Animation in QML

Qt allows us to easily animate a UI component without writing a bunch of code. In this example, we will learn how to make our program's UI more interesting by applying animations to it.

How to do it…

  1. Once again, we will start everything from scratch. Therefore, create a new Qt Quick application project in Qt Creator and open up MainForm.ui.qml.
  2. Go to the Imports tab in the Library window and add a Qt Quick module called QtQuick.Controls to your project.
  3. After that, you will see a new category appear in the QML Types tab called Qt Quick - Controls, which contains many new widgets that can be placed on the canvas.
  4. Next, drag three button widgets to the canvas and set their height to 45. Then, go to the Layout tab on the Properties window ...

Get Qt5 C++ GUI Programming Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.