~ubuntu-branches/ubuntu/saucy/qtdeclarative-opensource-src/saucy

« back to all changes in this revision

Viewing changes to tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 14:17:19 UTC
  • Revision ID: package-import@ubuntu.com-20130205141719-qqeyml8wslpyez52
Tags: upstream-5.0.1
ImportĀ upstreamĀ versionĀ 5.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
Item {
 
4
    id: root
 
5
 
 
6
    property bool success: false
 
7
 
 
8
    Component {
 
9
        id: internalComponent
 
10
 
 
11
        Item {
 
12
            id: internalRoot
 
13
 
 
14
            property string foo: ''
 
15
 
 
16
            Component.onCompleted: { internalRoot.foo = 'bar' }
 
17
            Component.onDestruction: { root.success = (internalRoot.foo == 'bar') }
 
18
        }
 
19
    }
 
20
 
 
21
    Component.onCompleted: {
 
22
        internalComponent.createObject()
 
23
        gc()
 
24
    }
 
25
}