summaryrefslogtreecommitdiff
path: root/tests/auto/qml/windowmapping/apps/test.winmap.qtobject/qtobject.qml
blob: 51e395bf05da89bd9e05e760eafe1cc9055c2d83 (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
// 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

QtObject {
    id: root

    property ApplicationManagerWindow mainWin: ApplicationManagerWindow {
        id: main
        visible: false
    }

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

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