-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.qml
57 lines (47 loc) · 1.42 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
import QtQuick
import QtQuick.Layouts
Window {
id: main
width: 1920/3
height: 1080/3
visible: true
title: qsTr("REMOTE_CONTROL")
property double contentRotation : width > height ? 0 : 90
property double contentWidth : width > height ? width : height
property double contentHeight : width > height ? height : width
Controller {
id: joystickPage
anchors.centerIn: parent
rotation : main.contentRotation
width : main.contentWidth
height : main.contentHeight
onShowDevices : {
pagesLayout.visible = true
}
StackLayout {
id: pagesLayout
anchors.fill: parent
visible : false
currentIndex: 0
Devices {
onShowServices: pagesLayout.currentIndex = 1
}
// Services {
// onShowDevices: pagesLayout.currentIndex = 0
// onShowCharacteristics: pagesLayout.currentIndex = 2
// }
// Characteristics {
// onShowDevices: pagesLayout.currentIndex = 0
// onShowServices: pagesLayout.currentIndex = 1
// }
}
Connections {
target: Device
function onRxTxConnectedChanged() {
if (Device.rxTxConnected) {
pagesLayout.visible = false
}
}
}
}
}