diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-06-18 15:06:16 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-22 00:13:28 +0200 |
commit | fa457e593deca9fcffe2d6ec6ca0aa40d9fa7b76 (patch) | |
tree | a8e53434055544fcf3ebeb9ba5982b3d7f72cf38 /tests/auto/qml/qqmlecmascript/testtypes.h | |
parent | 57e3325affbe8bbb8edcc2c6d072db28aee46438 (diff) |
Support enum return types in Q_INVOKABLE functions.
Handle enums correctly when used as the return type of a Q_INVOKABLE
function.
Task-number: QTBUG-23543
Change-Id: I14a506ffee08f5ba6aa0fdf27d6104a3ae5c48b3
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/testtypes.h')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/testtypes.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h index 2631002719..8f3804a05b 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.h +++ b/tests/auto/qml/qqmlecmascript/testtypes.h @@ -187,6 +187,8 @@ public: int intProperty() const { return m_intProperty; } void setIntProperty(int i) { m_intProperty = i; emit intChanged(); } + Q_INVOKABLE MyEnum2 getEnumValue() const { return EnumValue4; } + signals: void basicSignal(); void argumentSignal(int a, QString b, qreal c, MyEnum2 d, Qt::MouseButtons e); @@ -695,6 +697,8 @@ public: Q_INVOKABLE void method_overload(const QJsonArray &a) { invoke(26); m_actuals << QVariant::fromValue(a); } Q_INVOKABLE void method_overload(const QJsonValue &a) { invoke(27); m_actuals << QVariant::fromValue(a); } + Q_INVOKABLE void method_unknown(MyInvokableObject *o) { invoke(28); } + private: friend class MyInvokableBaseObject; void invoke(int idx) { if (m_invoked != -1) m_invokedError = true; m_invoked = idx;} |