summaryrefslogtreecommitdiff
path: root/tests/auto/qml/windowmapping/apps/test.winmap.amwin2/amwin2.qml
blob: f80a3ce941137cdbe2b4e0e266cd24098b71085a (plain)
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
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2019 Luxoft Sweden AB
// Copyright (C) 2018 Pelagicore AG
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.4
import QtApplicationManager.Application 2.0

ApplicationManagerWindow {
    id: root
    visible: false

    ApplicationManagerWindow {
        id: sub
        visible: false
        Component.onCompleted: setWindowProperty("type", "sub");
    }

    Rectangle {
        anchors.fill: parent
        visible: false

        ApplicationManagerWindow {
            id: sub2
            visible: false
            Component.onCompleted: setWindowProperty("type", "sub2");
        }
    }

    Connections {
        target: ApplicationInterface
        function onOpenDocument(documentUrl) {
            switch (documentUrl) {
            case "show-main": root.visible = true; break;
            case "hide-main": root.visible = false; break;
            case "show-sub": sub.visible = true; break;
            case "hide-sub": sub.visible = false; break;
            case "show-sub2": sub2.visible = true; break;
            case "hide-sub2": sub2.visible = false; break;
            }
        }
    }
}