/
main.qml
63 lines (56 loc) · 2 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
58
59
60
61
62
63
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import "pages"
import "scripts/main.js" as JS
Window {
visible: true
width: Math.min(Screen.desktopAvailableWidth, Screen.desktopAvailableHeight)
height: Math.min(Screen.desktopAvailableWidth,
Screen.desktopAvailableHeight)
title: qsTr("Hello World")
Item {
id: rootItem
anchors.fill: parent
StackView {
anchors.fill: parent
id: rootStackView
initialItem: splashScreen
onCurrentItemChanged: {
if (Qt.isQtObject(rootStackView.currentItem)) {
rootStackView.currentItem.requestStackChange.connect(
rootStackView.push)
}
}
}
Component {
id: splashScreen
SplashScreen {
width: Math.min(Screen.desktopAvailableWidth,
Screen.desktopAvailableHeight)
height: Math.min(Screen.desktopAvailableWidth,
Screen.desktopAvailableHeight)
}
}
Component {
id: mainMenu
MainMenu {
width: Math.min(Screen.desktopAvailableWidth,
Screen.desktopAvailableHeight)
height: Math.min(Screen.desktopAvailableWidth,
Screen.desktopAvailableHeight)
}
}
Component.onCompleted: {
// clear the stack view after 3 seconds
// JS.appendAnimationObject(rootItem, 3000, function () {
// rootStackView.clear()
// console.log("Clearing Stack View!")
// })
JS.appendAnimationObject(rootItem, 3500, function () {
JS.pushComponentToStack(mainMenu, rootStackView)
console.log("Loading Main Menu!")
})
}
}
}