diff options
author | Corentin Jabot <corentinjabot@gmail.com> | 2016-05-29 21:33:59 +0200 |
---|---|---|
committer | Corentin Jabot <corentinjabot@gmail.com> | 2016-06-05 15:25:40 +0000 |
commit | 8c8ec31b7ac79b10b5db0825ee338fc95e24a76f (patch) | |
tree | 137926aa50a1df686e4b546707c054c153e3b072 /src/qml/jsapi/qjsvalue.h | |
parent | bfa87b7bd8f8fb94889fd99ee413e69bc17f9e81 (diff) |
Add QJSEngine::newQMetaObject
QJSEngine::newQMetaObject let us expose QMetaObject to the QJSEngine,
allowing to construct QObjects instance from javascript.
Additionally, enums values are exposed as property of the QMetaObject
wrapper.
(The engine takes ownership of the created objects)
Change-Id: I5428d4b7061cceacfa89f51e703dce3379b2c329
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.h')
-rw-r--r-- | src/qml/jsapi/qjsvalue.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsvalue.h b/src/qml/jsapi/qjsvalue.h index e207e1b099..ab20a2607d 100644 --- a/src/qml/jsapi/qjsvalue.h +++ b/src/qml/jsapi/qjsvalue.h @@ -98,6 +98,7 @@ public: bool isUndefined() const; bool isVariant() const; bool isQObject() const; + bool isQMetaObject() const; bool isObject() const; bool isDate() const; bool isRegExp() const; @@ -111,6 +112,7 @@ public: bool toBool() const; QVariant toVariant() const; QObject *toQObject() const; + const QMetaObject *toQMetaObject() const; QDateTime toDateTime() const; bool equals(const QJSValue &other) const; |