-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSimple.qml
56 lines (49 loc) · 1.37 KB
/
Simple.qml
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
import QtQuick.Controls
import QtQuick.Layouts
Item {
id: itemId
visible: true
width: 400
height: 300
// Property to store the concatenated string
property string concatenatedString: ""
ColumnLayout {
anchors.centerIn: parent
spacing: 10
// Text output to display the concatenated string
Text {
id: outputText
text: itemId.concatenatedString
font.pixelSize: 20
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
}
// Buttons to add words to the string
RowLayout {
spacing: 10
Button {
objectName: "hello"
text: "Add 'Hello'"
onClicked: itemId.concatenatedString += "Hello "
}
Button {
objectName: "world"
text: "Add 'World'"
onClicked: itemId.concatenatedString += "World "
}
Button {
objectName: "qt"
text: "Add 'Qt'"
onClicked: itemId.concatenatedString += "Qt "
}
}
// Reset button to clear the string
Button {
objectName: "reset"
text: "Reset"
onClicked: itemId.concatenatedString = ""
}
}
}