-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
45 lines (40 loc) · 980 Bytes
/
main.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
import QtQuick 6
import QtQuick.Controls 2.15
ApplicationWindow {
id : window
width : 400
height : 200
visible : true
title : qsTr("Dinamic Language Switcher")
// Language ComboBox
ComboBox {
id : combo
x : 50
y : 50
anchors.horizontalCenter : parent.horizontalCenter
textRole : "text"
valueRole : "value"
onActivated : backend.switchLanguage(currentValue)
model : [
{
value: "en-US",
text: qsTr("English")
}, {
value: "fr-FR",
text: qsTr("Français")
}, {
value: "zh-CN",
text: qsTr("Chinese")
}
]
}
Text {
anchors.bottom : combo.top
anchors.margins : 20
anchors.horizontalCenter : parent.horizontalCenter
text : qsTr("Sample Text")
}
Connections {
target : backend
}
}