Refactor singleton type registration code
[profile/ivi/qtdeclarative.git] / tests / auto / qml / qqmlecmascript / data / singletontype / qobjectSingletonType.qml
1 import QtQuick 2.0
2
3 import Qt.test 1.0 as QtTest                                    // singleton Type installed into existing uri
4 import Qt.test.qobjectApi 1.0 as QtTestQObjectApi               // qobject singleton Type installed into new uri
5 import Qt.test.qobjectApi 1.3 as QtTestMinorVersionQObjectApi   // qobject singleton Type installed into existing uri with new minor version
6 import Qt.test.qobjectApi 2.0 as QtTestMajorVersionQObjectApi   // qobject singleton Type installed into existing uri with new major version
7 import Qt.test.qobjectApiParented 1.0 as QtTestParentedQObjectApi // qobject (with parent) singleton Type installed into a new uri
8
9 QtObject {
10     property int existingUriTest: QtTest.QObject.qobjectTestProperty
11     property int qobjectTest: QtTestQObjectApi.QObject.qobjectTestProperty
12     property int qobjectMethodTest: 3
13     property int qobjectMinorVersionMethodTest: 3
14     property int qobjectMinorVersionTest: QtTestMinorVersionQObjectApi.QObject.qobjectTestProperty
15     property int qobjectMajorVersionTest: QtTestMajorVersionQObjectApi.QObject.qobjectTestProperty
16     property int qobjectParentedTest: QtTestParentedQObjectApi.QObject.qobjectTestProperty
17
18     Component.onCompleted: {
19         qobjectMethodTest = QtTestQObjectApi.QObject.qobjectTestMethod(); // should be 1
20         qobjectMethodTest = QtTestQObjectApi.QObject.qobjectTestMethod(); // should be 2
21         qobjectMinorVersionMethodTest = QtTestMinorVersionQObjectApi.QObject.qobjectTestMethod(); // should be 1
22     }
23 }
24