diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-08-22 17:21:36 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-09-02 22:44:29 +0200 |
commit | ad32ac5b4f05c9eed1fb7a93ee7947050d840a19 (patch) | |
tree | 5f14ae7a6a588ad3c9400058943f675556a403a9 /src/corelib/kernel/qmetaobject.h | |
parent | 3e6c09279304fbde1860288717958e28377b9a9c (diff) |
Make bindings introspectable through moc
Add a new BINDABLE declaration to the Q_PROPERTY() macro that tells moc
where to find the QBindable for the property.
Add a QUntypedBindable base class to QBindable<T> that gives access to
generic functionality and checks argument compatibility at runtime.
QBindable<T> will still do static checking at compile time.
Add QMetaProperty::isBindable() and QMetaProperty::bindable()
to be able to dynamically access the binding functionality.
Change-Id: Ic7b08ae2cde83fd43e627d813a886e1de01fa3dc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.h')
-rw-r--r-- | src/corelib/kernel/qmetaobject.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index 8136e04dc9..08c57d5f28 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE +class QUntypedBindable; + #define Q_METAMETHOD_INVOKE_MAX_ARGS 10 class Q_CORE_EXPORT QMetaMethod @@ -294,7 +296,7 @@ public: bool isConstant() const; bool isFinal() const; bool isRequired() const; - bool isQProperty() const; + bool isBindable() const; bool isFlagType() const; bool isEnumType() const; @@ -310,6 +312,8 @@ public: bool write(QObject *obj, const QVariant &value) const; bool reset(QObject *obj) const; + QUntypedBindable bindable(QObject *object) const; + QVariant readOnGadget(const void *gadget) const; bool writeOnGadget(void *gadget, const QVariant &value) const; bool resetOnGadget(void *gadget) const; |