diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-16 02:35:08 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-31 01:17:15 (GMT) |
commit | 7ebd2024f49bdaf798f0beaaa35946dfa890f276 (patch) | |
tree | f68cad7641b1f0aa6242acadb480a6cb6969002e /src/corelib/kernel | |
parent | 29202f033c87b5efe305e606805a26c59886875b (diff) | |
download | Qt-7ebd2024f49bdaf798f0beaaa35946dfa890f276.zip Qt-7ebd2024f49bdaf798f0beaaa35946dfa890f276.tar.gz Qt-7ebd2024f49bdaf798f0beaaa35946dfa890f276.tar.bz2 |
Add FINAL attribute to Q_PROPERTY()
This will be used by the declarative module to optimize property bindings.
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 17 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index fee2da9..3b09061 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -161,7 +161,8 @@ enum PropertyFlags { ResolveUser = 0x00200000, Notify = 0x00400000, Dynamic = 0x00800000, - Constant = 0x00000400 + Constant = 0x00000400, + Final = 0x00000800 }; enum MethodFlags { @@ -2466,6 +2467,20 @@ bool QMetaProperty::isConstant() const } /*! + Returns true if the property is final; otherwise returns false. + + A property is final if the \c{Q_PROPERTY()}'s \c FINAL attribute + is set. +*/ +bool QMetaProperty::isFinal() const +{ + if (!mobj) + return false; + int flags = mobj->d.data[handle + 2]; + return flags & Final; +} + +/*! \obsolete Returns true if the property is editable for the given \a object; diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index 73b52a9..bd47582 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -189,6 +189,7 @@ public: bool isUser(const QObject *obj = 0) const; bool isDynamic() const; bool isConstant() const; + bool isFinal() const; bool isFlagType() const; bool isEnumType() const; |