From a6f56251ca6090cb0ba4c4989d7ccc638b1dbe2b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 2 Jan 2020 12:24:15 +0100 Subject: Fix some qdoc warnings src/corelib/tools/qhash.cpp:2596: (qdoc) warning: clang found diagnostics parsing \fn template template QMultiHash::QMultiHash(InputIterator begin, InputIterator end) error: 'QMultiHash' is not a class, namespace, or enumeration src/corelib/kernel/qobject.cpp:4593: (qdoc) warning: Undocumented parameter 'EXPORT_MACRO' in QObject::Q_NAMESPACE_EXPORT src/corelib/global/qfloat16.cpp:129: (qdoc) warning: Cannot tie this documentation to anything src/corelib/text/qlocale.qdoc:1204: (qdoc) warning: Overrides a previous doc src/corelib/text/qlocale.qdoc:1187: (qdoc) warning: (The previous doc is here) src/network/kernel/qhostinfo.cpp:597: (qdoc) warning: clang found diagnostics parsing \fn QHostInfo(QHostInfo &&other) src/printsupport/dialogs/qabstractprintdialog.cpp:346: (qdoc) warning: clang found diagnostics parsing \fn int QAbstractPrintDialog::exec(): error: out-of-line definition of 'exec' does not match any declaration in 'QAbstractPrintDialog' src/testlib/qsignalspy.qdoc:101: (qdoc) warning: clang found diagnostics parsing \fn QSignalSpy(const QObject *obj, const QMetaMethod &signal): error: expected unqualified-id src/testlib/doc/src/qttest-best-practices.qdoc:28: (qdoc) warning: Can't link to 'Q_VERIFY2()' src/widgets/kernel/qactiongroup.cpp:291: (qdoc) warning: Undocumented parameter 'b' in QActionGroup::setExclusive() src/widgets/kernel/qactiongroup.cpp:305: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text src/widgets/kernel/qshortcut.cpp:542: (qdoc) warning: No such parameter 'context' in QShortcut::QShortcut() src/widgets/widgets/qdatetimeedit.cpp:632: (qdoc) warning: No such parameter 'minimumTime' in QDateTimeEdit::setTimeRange() src/widgets/widgets/qdatetimeedit.cpp:632: (qdoc) warning: No such parameter 'maximumTime' in QDateTimeEdit::setTimeRange() src/widgets/widgets/qdatetimeedit.cpp:632: (qdoc) warning: No such parameter 'less' in QDateTimeEdit::setTimeRange() Change-Id: I9799b5135e84c4d811674b2d114ef27315bc12df Reviewed-by: Paul Wicking --- src/corelib/kernel/qobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index cf107498dd..cc50d9ccc7 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4612,7 +4612,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) It works exactly like the Q_NAMESPACE macro. However, the external \c{staticMetaObject} variable that gets defined in the namespace - is declared with the supplied \c{EXPORT_MACRO} qualifier. This is + is declared with the supplied \a EXPORT_MACRO qualifier. This is useful if the object needs to be exported from a dynamic library. \sa Q_NAMESPACE, {Creating Shared Libraries} -- cgit v1.2.3 From 8669b8e60fc6a46baaeeea264a1ed3008dd52ea2 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Wed, 11 Dec 2019 10:54:57 +0100 Subject: QVariant: Prefer direct conversion to QVariant{List,Map,Hash} If a type has both a converter to QVariantList and to QSequentialIterableImpl registered, we would have chosen the QSequentialIterableImpl version. In the case of types like QJSValue, this is more costly. With this change we therefore uses the direct conversion if it has been registered. The same applies to QAssociativeIterableImpl and QVariantHash/QVariantMap. Change-Id: I9c0b5068efe4bfbc5e0598a200e6db59201e9974 Reviewed-by: Ulf Hermann Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/kernel/qvariant.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index a4957472ec..c95882d48f 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -801,7 +801,8 @@ namespace QtPrivate { static QVariantList invoke(const QVariant &v) { const int typeId = v.userType(); - if (typeId == qMetaTypeId() || typeId == qMetaTypeId() || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId())) { + if (typeId == qMetaTypeId() || typeId == qMetaTypeId() || + (QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId()) && !QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId()))) { QSequentialIterable iter = QVariantValueHelperInterface::invoke(v); QVariantList l; l.reserve(iter.size()); @@ -818,7 +819,7 @@ namespace QtPrivate { static QVariantHash invoke(const QVariant &v) { const int typeId = v.userType(); - if (typeId == qMetaTypeId() || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId())) { + if (typeId == qMetaTypeId() || ((QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId())) && !QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId()))) { QAssociativeIterable iter = QVariantValueHelperInterface::invoke(v); QVariantHash l; l.reserve(iter.size()); @@ -835,7 +836,7 @@ namespace QtPrivate { static QVariantMap invoke(const QVariant &v) { const int typeId = v.userType(); - if (typeId == qMetaTypeId() || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId())) { + if (typeId == qMetaTypeId() || (QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId()) && !QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId()))) { QAssociativeIterable iter = QVariantValueHelperInterface::invoke(v); QVariantMap l; for (QAssociativeIterable::const_iterator it = iter.begin(), end = iter.end(); it != end; ++it) @@ -851,10 +852,8 @@ namespace QtPrivate { static QPair invoke(const QVariant &v) { const int typeId = v.userType(); - if (typeId == qMetaTypeId >()) - return QVariantValueHelper >::invoke(v); - if (QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId())) { + if (QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId()) && !(typeId == qMetaTypeId >())) { QtMetaTypePrivate::QPairVariantInterfaceImpl pi = v.value(); const QtMetaTypePrivate::VariantData d1 = pi.first(); -- cgit v1.2.3