10402
|
1 |
import QtQuick 2.0
|
|
2 |
|
|
3 |
Rectangle {
|
10422
|
4 |
id: pages
|
|
5 |
width: 800
|
|
6 |
height: 600
|
|
7 |
|
|
8 |
property variant pagesList : [
|
|
9 |
"First"
|
|
10 |
, "LocalGame"
|
|
11 |
, "GameConfig"
|
|
12 |
];
|
|
13 |
|
|
14 |
property string currentPage : "First";
|
|
15 |
|
|
16 |
Repeater {
|
|
17 |
model: pagesList;
|
10402
|
18 |
|
10422
|
19 |
delegate: Loader {
|
|
20 |
active: false
|
|
21 |
asynchronous: true
|
|
22 |
anchors.fill: parent
|
|
23 |
visible: (currentPage === modelData)
|
|
24 |
source: "%1.qml".arg(modelData)
|
|
25 |
onVisibleChanged: loadIfNotLoaded();
|
|
26 |
Component.onCompleted: loadIfNotLoaded();
|
10402
|
27 |
|
10422
|
28 |
function loadIfNotLoaded ()
|
|
29 |
{
|
|
30 |
if (visible && !active)
|
|
31 |
active = true;
|
|
32 |
}
|
10420
|
33 |
}
|
10402
|
34 |
}
|
|
35 |
}
|