Time for action – Adding an import

The default object palette contains a very minimal set of types provided by the QtQuick module. To access a richer set of controls, we need to add an import directive to our document. To do this, locate the Library pane in the top-left corner of the window and go to its Imports tab. Next, click on Add Import and select QtQuick.Controls 2.2 in the drop-down list. The selected import will appear in the tab. You can click on the × button to the left of the import to remove it. Note that you cannot remove the default import.

Adding the import using the form editor will result in adding the import QtQuick.Controls 2.2 directive to the .ui.qml file. You can switch the main area to the Text Editor mode to see this ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.