~saviq/ubuntu/saucy/qtdeclarative-opensource-src/add-qtquick-delegate-range

« back to all changes in this revision

Viewing changes to tests/auto/qml/qqmlengine/data/testVMEAggregateVMEComponent.1.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
    property bool success: false
 
5
 
 
6
    function reportError(s) { console.warn(s) }
 
7
 
 
8
    Component.onCompleted: {
 
9
        componentCache.trim()
 
10
        if (!componentCache.isTypeLoaded('testVMEAggregateVMEComponent.1.qml')) return reportError('Test component not loaded')
 
11
        if (componentCache.isTypeLoaded('VMEExtendVMEComponent.qml')) return reportError('Aggregate component already loaded')
 
12
        if (componentCache.isTypeLoaded('VMEComponent.qml')) return reportError('VME component already loaded')
 
13
 
 
14
        var comp = Qt.createComponent('VMEAggregateVMEComponent.qml')
 
15
        componentCache.trim()
 
16
        if (!componentCache.isTypeLoaded('testVMEAggregateVMEComponent.1.qml')) return reportError('Test component not loaded 2')
 
17
        if (!componentCache.isTypeLoaded('VMEAggregateVMEComponent.qml')) return reportError('Aggregate component not loaded')
 
18
        if (!componentCache.isTypeLoaded('VMEComponent.qml')) return reportError('VME component not loaded')
 
19
 
 
20
        var obj = comp.createObject()
 
21
        if (!obj) return reportError('Invalid object')
 
22
        if (obj.foo != 'bar') return reportError('Invalid object 2')
 
23
        if (obj.children[0].foo != 'bar') return reportError('Invalid object 3')
 
24
 
 
25
        obj.destroy()
 
26
        componentCache.trim()
 
27
        if (!componentCache.isTypeLoaded('testVMEAggregateVMEComponent.1.qml')) return reportError('Test component not loaded 3')
 
28
        if (!componentCache.isTypeLoaded('VMEAggregateVMEComponent.qml')) return reportError('Aggregate component already unloaded')
 
29
        if (!componentCache.isTypeLoaded('VMEComponent.qml')) return reportError('VME component already unloaded')
 
30
 
 
31
        comp.destroy()
 
32
        componentCache.trim()
 
33
        if (!componentCache.isTypeLoaded('testVMEAggregateVMEComponent.1.qml')) return reportError('Test component not loaded 4')
 
34
        if (componentCache.isTypeLoaded('VMEAggregateVMEComponent.qml')) return reportError('Aggregate component not unloaded')
 
35
        if (componentCache.isTypeLoaded('VMEComponent.qml')) return reportError('VME component not unloaded')
 
36
 
 
37
        success = true
 
38
    }
 
39
}