O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – Adding a form to the project

Locate the qml.qrc file in Qt Creator's project tree and invoke the Add New... option in its context menu. From Qt section, select the QtQuick UI File template. Input Calculator in the Component name field. The Component form name field will be automatically set to CalculatorForm. Finish the wizard.

Two new files will appear in our project. The CalculatorForm.ui.qml file is the form file that can be edited in the form editor. The Calculator.qml file is a regular QML file that can be edited manually to implement the behavior of the form. Each of these files introduces a new QML type. The CalculatorForm QML type is immediately used in the generated Calculator.qml file:

import QtQuick 2.4CalculatorForm ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required