aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/nodetypes_ng/MoreWindows.qml
blob: 9ba703dedb474ee07ff43e0ab8f6072a1fd82675 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick 2.0
import QtQuick.Window 2.12

Item {
    Rectangle {
        x: 20
        y: 20
        width: 300
        height: 120
        color: "red"
        border.color: "black"
        border.width: 2
        Text {
            text: "Click to toggle window visibility\n(switch to another test to destroy)"
            font.bold: true
            anchors.centerIn: parent
        }
        MouseArea {
            anchors.fill: parent
            onClicked: win.visible = !win.visible
        }
    }

    Rectangle {
        width: 100
        height: 100
        anchors.centerIn: parent
        color: "green"
        NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
    }

    Window {
        id: win
        width: 640
        height: 480

        Rectangle {
            color: "lightGray"
            anchors.fill: parent
            Rectangle {
                width: 100
                height: 100
                anchors.centerIn: parent
                color: "red"
                NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
            }
            Text {
                text: "Another QQuickWindow"
                anchors.top: parent.top
                anchors.margins: 20
                ColorAnimation on color { from: "red"; to: "green"; duration: 2000; loops: Animation.Infinite }
            }
        }
    }
}