summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtimer.h
diff options
context:
space:
mode:
authorSergio Martins <iamsergio@gmail.com>2018-08-27 21:55:04 +0100
committerSérgio Martins <sergio.martins@kdab.com>2018-09-03 08:43:39 +0000
commit179c88a1a99c4b035e0b195c5fea9b23e0d06479 (patch)
tree320bfdc7613f91ee1693c0b3a537d4a4c2f7c3c3 /src/corelib/kernel/qtimer.h
parent604c03f0b96909ae086c9f5c5bc8f7eabc7f48fb (diff)
Rename QTimer::connectTo() to QTimer::callOnTimeout()
Some people suggested the later, so let's have a second look at it before it's too late. Although I was in favor of the former I'm now having second thoughts. connectTo() is meant to only be used in classes which have a clear dominant signal, but there are rare classes that have two (example: QAbstractButton::toggled, QAbstractButton::clicked). QAbstractButton::connectTo() would be ambiguous if we ever wanted to add these shorthand connects to QtWidgets Change-Id: I198ad3326d31dcf89b9c47a299124572ee7b11b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qtimer.h')
-rw-r--r--src/corelib/kernel/qtimer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index f5c04c7f70..66f317c567 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -97,11 +97,11 @@ public:
template<typename Functor, int>
static void singleShot(int msec, Qt::TimerType timerType, const QObject *context, Functor functor);
template <typename Functor>
- QMetaObject::Connection connectTo(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename Functor>
- QMetaObject::Connection connectTo(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename PointerToMemberFunction>
- QMetaObject::Connection connectTo(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
#else
// singleShot to a QObject slot
template <typename Duration, typename Func1>
@@ -160,7 +160,7 @@ public:
}
template <typename ... Args>
- QMetaObject::Connection connectTo(Args && ...args)
+ QMetaObject::Connection callOnTimeout(Args && ...args)
{
return QObject::connect(this, &QTimer::timeout, std::forward<Args>(args)... );
}