Changes in QML types
In this chapter, we will learn what changes have been made in Qt 6 compared to Qt 5.
How to do it…
Let’s get started by following these steps:
- Create a new Qt Quick Application by going to File | New Project.
- Select the Qt 6.2 option for Minimum required Qt version when defining project details.
Figure 6.5 – Select Qt 6.2 as Minimum required Qt version
- Once you have created the project, open up
main.qmland add these properties to the file:import QtQuick Window { width: 640 height: 480 visible: true title: qsTr("Hello World") property variant myColor: "red" property url imageFolder: "/images" - Next, add a
Rectangleobject tomain.qml, as shown in the following:Rectangle { id: rect ...