diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-30 06:27:28 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-31 02:00:42 (GMT) |
commit | b30a25280556599177b217f0e8ed3fbe4b11705d (patch) | |
tree | 2f32cd0c73f9c8a8f560b754459235546f0dd01d /src/corelib/kernel/qmetaobject.cpp | |
parent | 45c11a97a32170d0c6ab9265a102cc8d94fa63ee (diff) | |
download | Qt-b30a25280556599177b217f0e8ed3fbe4b11705d.zip Qt-b30a25280556599177b217f0e8ed3fbe4b11705d.tar.gz Qt-b30a25280556599177b217f0e8ed3fbe4b11705d.tar.bz2 |
Add index methods to QMetaProperty and QMetaMethod
Authored-by: Kent Hansen
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 3b09061..611eff3 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1329,6 +1329,16 @@ int QMetaMethod::attributes() const } /*! + Returns this method's index. +*/ +int QMetaMethod::methodIndex() const +{ + if (!mobj) + return -1; + return ((handle - priv(mobj->d.data)->methodData) / 5) + mobj->methodOffset(); +} + +/*! Returns the access specification of this method (private, protected, or public). @@ -2043,6 +2053,16 @@ int QMetaProperty::userType() const } /*! + Returns this property's index. +*/ +int QMetaProperty::propertyIndex() const +{ + if (!mobj) + return -1; + return idx + mobj->propertyOffset(); +} + +/*! Returns true if the property's type is an enumeration value that is used as a flag; otherwise returns false. |