diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-04 10:52:40 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-04 10:52:40 (GMT) |
commit | ac60946777c55cf19ee0fc5ae1f60d3c75146e6f (patch) | |
tree | 8c8a271c71e360d567a6a95278de1c903c1b6592 /src/corelib/kernel/qmetaobject.cpp | |
parent | f67f6bc8bcb2092da77905aa67942f59cd49470b (diff) | |
parent | bc331aca61a2f212a347708c9d44a4fb092183fd (diff) | |
download | Qt-ac60946777c55cf19ee0fc5ae1f60d3c75146e6f.zip Qt-ac60946777c55cf19ee0fc5ae1f60d3c75146e6f.tar.gz Qt-ac60946777c55cf19ee0fc5ae1f60d3c75146e6f.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
demos/declarative/samegame/SamegameCore/samegame.js
mkspecs/features/symbian/default_post.prf
src/declarative/qml/qdeclarativeengine.cpp
src/gui/text/qtextdocumentlayout.cpp
src/plugins/plugins.pro
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtGuiu.def
src/s60installs/s60installs.pro
tests/auto/declarative/declarative.pro
tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
tests/auto/declarative/qmlvisual/qmlvisual.pro
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. |