From 5ea233ca6782eb27adf596515cb66ef3dadc1d5e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Oct 2018 10:07:20 +0200 Subject: [PATCH] doc: Remove indistinguishable declaration QTimer contains a template member function callOnTimeout(), which accepts a variable number of arguments. Because it is difficult to document such a general function, several specific declarations were added under the guard Q_CLANG_QDOC that represent the typical ways this function is used. They are easier to document because they have specific signatures. Unfortunately, the clang parser recognizes two of them as being the same, so this change removes one of the two. It also adjusts the documentation of the remaining one so that it indicates both uses. Change-Id: Ifa7bed9093bd1491b7bfe154990864454885c003 Reviewed-by: Martin Smith --- src/corelib/kernel/qtimer.cpp | 23 +++++------------------ src/corelib/kernel/qtimer.h | 2 -- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 90f29aa630b..2059aae3ebc 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -585,29 +585,16 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template QMetaObject::Connection callOnTimeout(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template QMetaObject::Connection callOnTimeout(QObject *context, Functor function, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 \overload callOnTimeout() - Creates a connection from the timeout() signal to \a functor to be placed in a specific - event loop of \a context, and returns a handle to the connection. + Creates a connection from the timeout() signal to \a function, which could be a pointer + to a member function of \a context, or it could be a functor to be placed in a specific + event loop of \a context. It returns a handle to the connection. This method is provided for convenience. It's equivalent to calling - \c {QObject::connect(timer, &QTimer::timeout, context, functor, connectionType)}. - - \sa QObject::connect(), timeout() -*/ - -/*! - \fn template QMetaObject::Connection callOnTimeout(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection) - \since 5.12 - \overload callOnTimeout() - - Creates a connection from the timeout() signal to the \a method in the \a receiver object. Returns - a handle to the connection. - - This method is provided for convenience. It's equivalent to calling - \c {QObject::connect(timer, &QTimer::timeout, receiver, method, connectionType)}. + \c {QObject::connect(timer, &QTimer::timeout, context, function, connectionType)}. \sa QObject::connect(), timeout() */ diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 66f317c5670..9ff340854fb 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -100,8 +100,6 @@ public: QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); template QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); - template - QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection); #else // singleShot to a QObject slot template