summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
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 /tests/auto/corelib
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 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index 927ba49f83..8d194dafc1 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -75,7 +75,7 @@ private slots:
void dontBlockEvents();
void postedEventsShouldNotStarveTimers();
- void connectTo();
+ void callOnTimeout();
};
void tst_QTimer::zeroTimer()
@@ -979,7 +979,7 @@ void tst_QTimer::crossThreadSingleShotToFunctor()
delete o;
}
-void tst_QTimer::connectTo()
+void tst_QTimer::callOnTimeout()
{
QTimer timer;
QSignalSpy timeoutSpy(&timer, &QTimer::timeout);
@@ -989,9 +989,9 @@ void tst_QTimer::connectTo()
auto context = new QObject();
int count = 0;
- timer.connectTo([&count] { count++; });
- QMetaObject::Connection connection = timer.connectTo(context, [&count] { count++; });
- timer.connectTo(&timer, &QTimer::stop);
+ timer.callOnTimeout([&count] { count++; });
+ QMetaObject::Connection connection = timer.callOnTimeout(context, [&count] { count++; });
+ timer.callOnTimeout(&timer, &QTimer::stop);
QTest::qWait(100);