diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-03-01 09:40:06 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-03-01 09:40:06 (GMT) |
commit | 48cd01714e3aa76872983cae820cfc1c7504b065 (patch) | |
tree | 0d7cf0938619e845599fe2eb65f21e7999b66c50 /src/corelib/kernel/qmetaobject.cpp | |
parent | 4d803a3493d15fdf7374689b774d02662dbd43b3 (diff) | |
parent | 54869c8727e5403cea866c99a5f83ae9c8533f82 (diff) | |
download | Qt-48cd01714e3aa76872983cae820cfc1c7504b065.zip Qt-48cd01714e3aa76872983cae820cfc1c7504b065.tar.gz Qt-48cd01714e3aa76872983cae820cfc1c7504b065.tar.bz2 |
Merge remote-tracking branch 'origin/master' into lighthouse-master
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 7928f4f..c5775f6 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1387,6 +1387,25 @@ int QMetaMethod::methodIndex() const } /*! + \internal + + Returns the method revision if one was + specified by Q_REVISION, otherwise returns 0. + */ +int QMetaMethod::revision() const +{ + if (!mobj) + return 0; + if ((QMetaMethod::Access)(mobj->d.data[handle + 4] & MethodRevisioned)) { + int offset = priv(mobj->d.data)->methodData + + priv(mobj->d.data)->methodCount * 5 + + (handle - priv(mobj->d.data)->methodData) / 5; + return mobj->d.data[offset]; + } + return 0; +} + +/*! Returns the access specification of this method (private, protected, or public). @@ -2394,6 +2413,35 @@ int QMetaProperty::notifySignalIndex() const } /*! + \internal + + Returns the property revision if one was + specified by REVISION, otherwise returns 0. + */ +int QMetaProperty::revision() const +{ + if (!mobj) + return 0; + int flags = mobj->d.data[handle + 2]; + if (flags & Revisioned) { + int offset = priv(mobj->d.data)->propertyData + + priv(mobj->d.data)->propertyCount * 3 + idx; + // Revision data is placed after NOTIFY data, if present. + // Iterate through properties to discover whether we have NOTIFY signals. + for (int i = 0; i < priv(mobj->d.data)->propertyCount; ++i) { + int handle = priv(mobj->d.data)->propertyData + 3*i; + if (mobj->d.data[handle + 2] & Notify) { + offset += priv(mobj->d.data)->propertyCount; + break; + } + } + return mobj->d.data[offset]; + } else { + return 0; + } +} + +/*! Returns true if this property is writable; otherwise returns false. |