From f791c1c0b5e2fa65781462be14be95fcf652bf00 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 23 Sep 2020 11:55:06 +0200 Subject: Fix some qdoc warnings in QMetaType and QVariant Document new enum values, remove documentation for implicit members, fix parameters, and tie documentation to function definitions. Change-Id: I5f32d45be8709e5f614d099ddf21252e23e144f8 Reviewed-by: Paul Wicking --- src/corelib/kernel/qmetatype.cpp | 35 +++++++++++++---------------- src/corelib/kernel/qvariant.cpp | 48 +++++++++++++++------------------------- 2 files changed, 33 insertions(+), 50 deletions(-) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index a1dcf2d130..b3807b145d 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -324,6 +324,8 @@ Q_GLOBAL_STATIC(QMetaTypeCustomRegistry, customTypeRegistry) \value LongLong LongLong \value Short \c{short} \value Char \c{char} + \value Char16 \c{char16_t} + \value Char32 \c{char32_t} \value ULong \c{unsigned long} \value ULongLong ULongLong \value UShort \c{unsigned short} @@ -409,9 +411,10 @@ Q_GLOBAL_STATIC(QMetaTypeCustomRegistry, customTypeRegistry) \value NeedsDestruction This type has a non-trivial destructor. If the flag is not set calls to the destructor are not necessary before discarding objects. \value MovableType An instance of a type having this attribute can be safely moved by memcpy. \omitvalue SharedPointerToQObject - \value IsEnumeration This type is an enumeration - \value If the type is an Enumeration, its underlying type is unsigned - \value PointerToQObject This type is a pointer to a derived of QObject + \value IsEnumeration This type is an enumeration. + \value IsUnsignedEnumeration If the type is an Enumeration, its underlying type is unsigned. + \value PointerToQObject This type is a pointer to a derived of QObject. + \value IsPointer This type is a pointer to another type. \omitvalue WeakPointerToQObject \omitvalue TrackingPointerToQObject \omitvalue IsGadget \omit This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5. \endomit @@ -794,13 +797,6 @@ void QMetaType::unregisterMetaType(QMetaType type) } } -/*! - \fn QMetaType::~QMetaType() - - Destructs this object. -*/ - - /*! \fn template QMetaType QMetaType::fromType() \since 5.15 @@ -1699,7 +1695,7 @@ void QMetaType::unregisterConverterFunction(QMetaType from, QMetaType to) #ifndef QT_NO_DEBUG_STREAM /*! - Streams the object at \a rhs of type \a typeId to the debug stream \a dbg. Returns \c true + Streams the object at \a rhs to the debug stream \a dbg. Returns \c true on success, otherwise false. \since 5.2 */ @@ -1732,7 +1728,7 @@ bool QMetaType::debugStream(QDebug& dbg, const void *rhs) /*! \fn bool QMetaType::hasRegisteredDebugStreamOperator(int typeId) - \obsolete + \obsolete Use QMetaType::hasRegisteredDebugStreamOperator() instead. Returns \c true, if the meta type system has a registered debug stream operator for type id \a typeId. @@ -1740,7 +1736,6 @@ bool QMetaType::debugStream(QDebug& dbg, const void *rhs) */ /*! - \fn bool QMetaType::hasRegisteredDebugStreamOperator(int typeId) \since 6.0 Returns \c true, if the meta type system has a registered debug stream operator for this @@ -2434,7 +2429,7 @@ bool QMetaType::canConvert(QMetaType fromType, QMetaType toType) } /*! - bool QMetaType::compare(const void *lhs, const void *rhs, int typeId, int* result) + \fn bool QMetaType::compare(const void *lhs, const void *rhs, int typeId, int* result) \deprecated Use the non-static compare method instead Compares the objects at \a lhs and \a rhs. Both objects need to be of type \a typeId. @@ -2625,9 +2620,9 @@ Q_CORE_EXPORT int qMetaTypeTypeInternal(const char *typeName) #ifndef QT_NO_DATASTREAM /*! - Writes the object pointed to by \a data with the ID \a type to - the given \a stream. Returns \c true if the object is saved - successfully; otherwise returns \c false. + Writes the object pointed to by \a data to the given \a stream. + Returns \c true if the object is saved successfully; otherwise + returns \c false. The type must have been registered with Q_DECLARE_METATYPE() beforehand. @@ -2666,9 +2661,9 @@ bool QMetaType::save(QDataStream &stream, const void *data) const */ /*! - Reads the object of the specified \a type from the given \a - stream into \a data. Returns \c true if the object is loaded - successfully; otherwise returns \c false. + Reads the object of this type from the given \a stream into \a data. + Returns \c true if the object is loaded successfully; otherwise + returns \c false. The type must have been registered with Q_DECLARE_METATYPE() beforehand. diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 56f7ead1e5..f28cd5a7a0 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -459,34 +459,6 @@ static void customClear(QVariant::Private *d) Constructs an invalid variant. */ - -/*! - \fn QVariant::QVariant(QMetaType type, const void *copy) - - Constructs variant of type \a type, and initializes with - \a copy if \a copy is not \nullptr. - - Note that you have to pass the address of the variable you want stored. - - Usually, you never have to use this constructor, use QVariant::fromValue() - instead to construct variants from the pointer types represented by - \c QMetaType::VoidStar, and \c QMetaType::QObjectStar. - - \sa QVariant::fromValue(), QMetaType::Type -*/ - -/*! - \fn QVariant::QVariant(Type type) - - Constructs an uninitialized variant of type \a type. This will create a - variant in a special null state that if accessed will return a default - constructed value of the \a type. - - \sa isNull() -*/ - - - /*! \fn QVariant::create(int type, const void *copy) @@ -793,12 +765,28 @@ QVariant::QVariant(const QVariant &p) Constructs a new variant with the regular expression value \a re. */ +/*! + Constructs an uninitialized variant of type \a type. This will create a + variant in a special null state that if accessed will return a default + constructed value of the \a type. + + \sa isNull() +*/ QVariant::QVariant(Type type) { create(type, nullptr); } /*! - \internal - */ + Constructs variant of type \a type, and initializes with + \a copy if \a copy is not \nullptr. + + Note that you have to pass the address of the variable you want stored. + + Usually, you never have to use this constructor, use QVariant::fromValue() + instead to construct variants from the pointer types represented by + \c QMetaType::VoidStar, and \c QMetaType::QObjectStar. + + \sa QVariant::fromValue(), QMetaType::Type +*/ QVariant::QVariant(QMetaType type, const void *copy) : d(type) { customConstruct(&d, copy); -- cgit v1.2.3