April 2018
Beginner
714 pages
18h 21m
English
Create a new Qt Quick Application - Empty project. To create a clock, we will implement a component representing the clock needle, and we will use instances of that component in the actual clock element. In addition to this, we will make the clock a reusable component; therefore, we will create it in a separate file and instantiate it from within main.qml:
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Clock {
id: clock
anchors {
fill: parent
margins: 20
}
}
}
We use the anchors property group to expand the item to fit the whole window except for the 20-pixel margin for all four sides.
Before this code works, however, we need to add a new QML file for the Clock ...
Read now
Unlock full access