From 9140731319269c75f24e80075750971e00844906 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Mon, 22 Aug 2011 17:01:04 +1000 Subject: Add enums support to QObject module APIs This commit adds support for retrieving enum values from QObject module APIs. Task-number: QTBUG-21033 Task-number: QTBUG-21056 Change-Id: Ib2bd107f3f5905e2d2d35f8a20c55045ef9bb322 Reviewed-on: http://codereview.qt.nokia.com/3291 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Jones Reviewed-by: Aaron Kennedy --- tests/auto/declarative/qdeclarativeecmascript/testtypes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/auto/declarative/qdeclarativeecmascript/testtypes.h') diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index d88fcd0fd8..2738ee3d60 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -934,6 +934,7 @@ private: class testQObjectApi : public QObject { Q_OBJECT + Q_ENUMS(MyEnum) Q_PROPERTY (int qobjectTestProperty READ qobjectTestProperty NOTIFY qobjectTestPropertyChanged) Q_PROPERTY (int qobjectTestWritableProperty READ qobjectTestWritableProperty WRITE setQObjectTestWritableProperty NOTIFY qobjectTestWritablePropertyChanged) @@ -945,6 +946,8 @@ public: ~testQObjectApi() {} + enum MyEnum { EnumValue1 = 25, EnumValue2 = 42 }; + Q_INVOKABLE int qobjectEnumTestMethod(MyEnum val) { return (static_cast(val) + 5); } Q_INVOKABLE int qobjectTestMethod(int increment = 1) { m_methodCallCount += increment; return m_methodCallCount; } int qobjectTestProperty() const { return m_testProperty; } -- cgit v1.2.3