diff options
author | Chris Adams <christopher.adams@nokia.com> | 2011-08-22 15:51:28 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-02 01:34:21 +0200 |
commit | 6080375fed90c09bfabb96a0319817f14f693b05 (patch) | |
tree | 2f91acc1e37cf5a747086066b741fa68fa0bbe57 /tests/auto/declarative/qdeclarativeconnection/data/moduleapi-target.qml | |
parent | d481f2ff518df1e44103d1850e7d52bd69260c34 (diff) |
Allow conversion of QObject Module API to QVariant
This commit adds a conversion codepath for QV8TypeResource to QVariant
where the resource contains a QObject module API. This allows such a
module API to be used as the "target" in a Connections element.
Task-number: QTBUG-20937
Change-Id: I9214b531968f2e6981a86e643859a97297c6a02a
Reviewed-on: http://codereview.qt.nokia.com/3286
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeconnection/data/moduleapi-target.qml')
-rw-r--r-- | tests/auto/declarative/qdeclarativeconnection/data/moduleapi-target.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/moduleapi-target.qml b/tests/auto/declarative/qdeclarativeconnection/data/moduleapi-target.qml new file mode 100644 index 0000000000..8803f24542 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeconnection/data/moduleapi-target.qml @@ -0,0 +1,22 @@ +import QtQuick 2.0 +import MyTestModuleApi 1.0 as MyTestModuleApi + +Item { + id: rootObject + objectName: "rootObject" + property int newIntPropValue: 12 + + property int moduleIntPropChangedCount: 0 + property int moduleOtherSignalCount: 0 + + function setModuleIntProp() { + MyTestModuleApi.intProp = newIntPropValue; + newIntPropValue = newIntPropValue + 1; + } + + Connections { + target: MyTestModuleApi + onIntPropChanged: moduleIntPropChangedCount = moduleIntPropChangedCount + 1; + onOtherSignal: moduleOtherSignalCount = moduleOtherSignalCount + 1; + } +} |