aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml
blob: a49a86e1f3f78bc7f51d2d1253c094705cd018d5 (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
import QtQuick 2.0

Item {
    id: root

    property bool success: false

    Component {
        id: internalComponent

        Item {
            id: internalRoot

            property string foo: ''

            Component.onCompleted: { internalRoot.foo = 'bar' }
            Component.onDestruction: { root.success = (internalRoot.foo == 'bar') }
        }
    }

    Component.onCompleted: {
        internalComponent.createObject()
        gc()
    }
}