diff options
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 14d96e96fd..00d20d9300 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1001,7 +1001,7 @@ int QMetaObject::indexOfProperty(const char *name) const Q_ASSERT(priv(this->d.data)->revision >= 3); if (priv(this->d.data)->flags & DynamicMetaObject) { - QAbstractDynamicMetaObject *me = + QAbstractDynamicMetaObject *me = const_cast<QAbstractDynamicMetaObject *>(static_cast<const QAbstractDynamicMetaObject *>(this)); return me->createProperty(name, 0); @@ -1854,7 +1854,10 @@ const char *QMetaMethod::typeName() const way in the function declaration: \code - #define THISISTESTTAG // tag text + #ifndef Q_MOC_RUN + // define the tag text + # define THISISTESTTAG + #endif ... private slots: THISISTESTTAG void testFunc(); @@ -1871,8 +1874,13 @@ const char *QMetaMethod::typeName() const qDebug() << mm.tag(); // prints THISISTESTTAG \endcode - For the moment, - \c moc doesn't support any special tags. + For the moment, \c moc will extract and record all tags, but it will not + handle any of them specially. + + \note Since Qt 5.0, \c moc expands preprocessor macros, so it is necessary + to surround the definition with \c #ifndef \c Q_MOC_RUN, as shown in the + example above. This was not required in Qt 4. The code as shown above works + with Qt 4 too. */ const char *QMetaMethod::tag() const { @@ -1904,9 +1912,9 @@ int QMetaMethod::methodIndex() const return QMetaMethodPrivate::get(this)->ownMethodIndex() + mobj->methodOffset(); } +// This method has been around for a while, but the documentation was marked \internal until 5.1 /*! - \internal - + \since 5.1 Returns the method revision if one was specified by Q_REVISION, otherwise returns 0. */ @@ -2041,8 +2049,8 @@ QMetaMethod QMetaMethod::fromSignalImpl(const QMetaObject *metaObject, void **si \snippet code/src_corelib_kernel_qmetaobject.cpp 8 - QMetaObject::normalizedSignature() is used here to ensure that the format - of the signature is what invoke() expects. E.g. extra whitespace is + QMetaObject::normalizedSignature() is used here to ensure that the format + of the signature is what invoke() expects. E.g. extra whitespace is removed. If the "compute" slot does not take exactly one QString, one int @@ -2550,7 +2558,7 @@ static QByteArray qualifiedName(const QMetaEnum &e) A property has a name() and a type(), as well as various attributes that specify its behavior: isReadable(), isWritable(), - isDesignable(), isScriptable(), and isStored(). + isDesignable(), isScriptable(), revision(), and isStored(). If the property is an enumeration, isEnumType() returns true; if the property is an enumeration that is also a flag (i.e. its values @@ -2970,7 +2978,7 @@ QMetaMethod QMetaProperty::notifySignal() const { int id = notifySignalIndex(); if (id != -1) - return mobj->method(id); + return mobj->method(id); else return QMetaMethod(); } @@ -2978,7 +2986,7 @@ QMetaMethod QMetaProperty::notifySignal() const /*! \since 4.6 - Returns the index of the property change notifying signal if one was + Returns the index of the property change notifying signal if one was specified, otherwise returns -1. \sa hasNotifySignal() @@ -2994,8 +3002,9 @@ int QMetaProperty::notifySignalIndex() const } } +// This method has been around for a while, but the documentation was marked \internal until 5.1 /*! - \internal + \since 5.1 Returns the property revision if one was specified by REVISION, otherwise returns 0. |