aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qml/data/resizeItem.qml
blob: c416451ccc79dd7e9f30528d52dbfd95ac781442 (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
import QtQuick

Rectangle {
    id: rect
    color: "green"

    Timer {
        id: exitTimer
        running: false
        onTriggered: Qt.quit()
    }

    Timer {
        id: resizeTimer
        running: false
        onTriggered: {
            rect.width = 100
            rect.height = 50
            exitTimer.start()
        }
    }

    Window.onHeightChanged: {
        if (rect.Window.width > 0)
            console.info("window", rect.Window.width, rect.Window.height, "content", rect.width, rect.height)
        resizeTimer.start()
    }
}