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.
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
.Go to the Imports tab in the Library window and add a Qt Quick module called QtQuick.Controls to your project.
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.
Next, drag three button widgets to the canvas and set their height to
45
. Then, go to the Layout tab on the Properties window and enable both the left and right anchors for all the three button widgets. Make sure the target for the anchors are set to Parent and the margins remain as0
. This will make the buttons resize horizontally according to the width of the main window...