summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.h
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2018-01-03 12:11:38 +0100
committerMartin Smith <martin.smith@qt.io>2018-01-08 19:10:50 +0000
commit0fd0059a1328723199641ced96f0c4b98e44e9d9 (patch)
tree2a461cae1d85571e8af0dd452a792a6ee8d6219c /src/corelib/kernel/qobject.h
parentbeeb748b2ce1d4aab60213778e9342ad330e1e07 (diff)
doc: Correct qdoc warnings in qobject.cpp and qmetatype.cpp
clang required adding template clauses to a few \fn commands. There were also a few cases where Q_QDOC was changed to Q_CLANG_QDOC and a few cases where special declarations for qdoc were removed in favor of the actual declarations. Unfortunately, a few qdoc warnings remain unfixed for classes QObject and QMetaType, but these might be caused by minor bugs in clang-qdoc itself, so they will be fixed there. Change-Id: Ib586628cb6d2aa9cf4bcad303b5af09b412a7e57 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.h')
-rw-r--r--src/corelib/kernel/qobject.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index d297109acb..da9c422739 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -126,13 +126,11 @@ public:
virtual bool event(QEvent *event);
virtual bool eventFilter(QObject *watched, QEvent *event);
-#ifdef Q_QDOC
- static QString tr(const char *sourceText, const char *comment = nullptr, int n = -1);
- static QString trUtf8(const char *sourceText, const char *comment = nullptr, int n = -1);
+#ifdef Q_CLANG_QDOC
virtual const QMetaObject *metaObject() const;
static const QMetaObject staticMetaObject;
#endif
-#ifdef QT_NO_TRANSLATION
+#if defined(QT_NO_TRANSLATION) || defined(Q_CLANG_QDOC)
static QString tr(const char *sourceText, const char * = nullptr, int = -1)
{ return QString::fromUtf8(sourceText); }
#if QT_DEPRECATED_SINCE(5, 0)
@@ -154,7 +152,7 @@ public:
void moveToThread(QThread *thread);
int startTimer(int interval, Qt::TimerType timerType = Qt::CoarseTimer);
-#if QT_HAS_INCLUDE(<chrono>) || defined(Q_QDOC)
+#if QT_HAS_INCLUDE(<chrono>)
Q_ALWAYS_INLINE
int startTimer(std::chrono::milliseconds time, Qt::TimerType timerType = Qt::CoarseTimer)
{
@@ -220,7 +218,7 @@ public:
inline QMetaObject::Connection connect(const QObject *sender, const char *signal,
const char *member, Qt::ConnectionType type = Qt::AutoConnection) const;
-#ifdef Q_QDOC
+#ifdef Q_CLANG_QDOC
template<typename PointerToMemberFunction>
static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection);
template<typename PointerToMemberFunction, typename Functor>
@@ -337,7 +335,7 @@ public:
typename SignalType::ReturnType>(std::move(slot)),
type, types, &SignalType::Object::staticMetaObject);
}
-#endif //Q_QDOC
+#endif //Q_CLANG_QDOC
static bool disconnect(const QObject *sender, const char *signal,
const QObject *receiver, const char *member);
@@ -350,7 +348,7 @@ public:
{ return disconnect(this, nullptr, receiver, member); }
static bool disconnect(const QMetaObject::Connection &);
-#ifdef Q_QDOC
+#ifdef Q_CLANG_QDOC
template<typename PointerToMemberFunction>
static bool disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method);
#else
@@ -383,7 +381,7 @@ public:
return disconnectImpl(sender, reinterpret_cast<void **>(&signal), receiver, zero,
&SignalType::Object::staticMetaObject);
}
-#endif //Q_QDOC
+#endif //Q_CLANG_QDOC
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@@ -479,11 +477,6 @@ public:
};
#endif
-#ifdef Q_QDOC
-T qFindChild(const QObject *o, const QString &name = QString());
-QList<T> qFindChildren(const QObject *oobj, const QString &name = QString());
-QList<T> qFindChildren(const QObject *o, const QRegExp &re);
-#endif
#if QT_DEPRECATED_SINCE(5, 0)
template<typename T>
inline QT_DEPRECATED T qFindChild(const QObject *o, const QString &name = QString())
@@ -495,7 +488,7 @@ inline QT_DEPRECATED QList<T> qFindChildren(const QObject *o, const QString &nam
return o->findChildren<T>(name);
}
-#ifndef QT_NO_REGEXP
+#if !defined(QT_NO_REGEXP) || defined(Q_CLANG_QDOC)
template<typename T>
inline QT_DEPRECATED QList<T> qFindChildren(const QObject *o, const QRegExp &re)
{