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
qml.qrc
from theResource
folder in the project pane by right-clicking on it and selecting Open in Editor. Then, removeMainForm.ui.qml
from your project's resources, as we don't need it for this project:Next, open up
main.qml
, which is listed underqml.rc
in the project pane. After that, remove the entire section that referencesMainForm
. Now what is left is only theWindow
object inmain.qml
. After that, set an ID for the window and adjust its width and height to higher...