aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2011-05-06 13:18:19 +1000
committerChris Adams <christopher.adams@nokia.com>2011-05-06 13:56:10 +1000
commit24bb6f90f828c0dbed06a56536a3f33b35d36506 (patch)
treec5358296315a856f08e219c9c4fcebf300ed72b4 /tests/auto/declarative/qdeclarativeecmascript/testtypes.h
parente50b7c92998905efdd40314724480e3070bdbcb5 (diff)
Add unit test and documentation for module API
Related to commit ae6c7a44394d4a5f943f1fc92f4de015ec7bcc96. Previously, only property access on module API was tested. This commit adds a test which calls a method on a module API. It also adds documentation for the qmlRegisterModuleApi functions. Task-number: QMLNG-33 Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/testtypes.h')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index 320e60c82a..8c7b838976 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -939,12 +939,14 @@ class testQObjectApi : public QObject
public:
testQObjectApi(QObject* parent = 0)
- : QObject(parent), m_testProperty(0)
+ : QObject(parent), m_testProperty(0), m_testWritableProperty(0), m_methodCallCount(0)
{
}
~testQObjectApi() {}
+ Q_INVOKABLE int qobjectTestMethod() { m_methodCallCount += 1; return m_methodCallCount; }
+
int qobjectTestProperty() const { return m_testProperty; }
void setQObjectTestProperty(int tp) { m_testProperty = tp; emit qobjectTestPropertyChanged(tp); }
@@ -958,6 +960,7 @@ signals:
private:
int m_testProperty;
int m_testWritableProperty;
+ int m_methodCallCount;
};
void registerTypes();