File: cpp_tutorial.qml

package info (click to toggle)
verdigris 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,464 kB
  • sloc: cpp: 21,467; ansic: 2,065; makefile: 8
file content (56 lines) | stat: -rw-r--r-- 1,369 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick.Window 2.0
import CppTutorial 1.0

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Cpp Tutorial")

    ColumnLayout {
        anchors.fill: parent
        anchors.margins: 20

        TextField {
            Layout.fillWidth: true
            readOnly: true
            placeholderText: "Missing name"
            text: person && person.name
        }
        RowLayout {
            Layout.fillWidth: true
            TextField {
                Layout.fillWidth: true
                readOnly: true
                text: person && person.birthYear
            }
            Button {
                text: "+1"
                onClicked: person.birthYear += +1
            }
            Button {
                text: "-1"
                onClicked: person.birthYear += -1
            }
        }
        Item {
            Layout.fillWidth: true
            Layout.fillHeight: true
        }
        RowLayout {
            Layout.fillWidth: true
            TextField {
                id: renameName
                Layout.fillWidth: true
                placeholderText: "Enter new name here"
            }
            Button {
                text: "Rename"
                onClicked: person.name = renameName.text
            }
        }
    }
}