diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-11-08 16:20:44 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-18 15:42:58 +0100 |
commit | d4f044533111fcfb34fe3a785eeb7af7fdbefbdd (patch) | |
tree | 1b2ef0c8695655e6ee4c1ae5f13a731738d1da96 /src/corelib/kernel/qmetaobject.cpp | |
parent | b5f6a85d2745ab6ac97f593664d255906923e737 (diff) |
Add support for exposing public QProperty members in the meta-object system
At the moment this makes the type as well as the setter/getter available
through the meta-call as well as the ability to register observers and
bindings. Only QProperty members that are annotated with
Q_PROPERTY(type name) are made public through the meta-object.
Change-Id: I16b98fd318122c722b85ce61e39975284e0c2404
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 9be99d8c6a..e715093127 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -3506,6 +3506,21 @@ bool QMetaProperty::isRequired() const } /*! + \since 6.0 + Returns \c true if the property is implemented using a QProperty member; otherwise returns \c false. + + This can be used to detect the availability of QProperty related meta-call types ahead of + performing the call itself. +*/ +bool QMetaProperty::isQProperty() const +{ + if (!mobj) + return false; + int flags = mobj->d.data[handle + 2]; + return flags & IsQProperty; +} + +/*! \obsolete Returns \c true if the property is editable for the given \a object; |