In all the previous examples of this chapter, we have discussed the methods and techniques used to render 2D graphics with Qt's C++ API. However, we have yet to learn how to achieve similar results using the powerful QML script.
In this project, we'll be do something quite different:
As usual, the first step we should do is to create a new project by going to File | New File or Project and selecting Qt Quick Application as the project template.
Once you are done creating the new project, open up
Resourcefolder in the project pane by right-clicking on it and selecting Open in Editor. Then, remove
MainForm.ui.qmlfrom your project's resources, as we don't need it for this project:
Next, open up
main.qml, which is listed under
qml.rcin the project pane. After that, remove the entire section that references
MainForm. Now what is left is only the
main.qml. After that, set an ID for the window and adjust its width and height to higher...