qt5base-lts/tests/auto/corelib/kernel/qtimer
Sergio Martins a6d1456458 Add QTimer::connectTo(), a shorthand way of connecting to timeout()
There are a couple of Qt classes where you almost always use the
same signal, for example QTimer::timeout, QPushButton::clicked,
and QAction::triggered.

Simply doing timer.connectTo([]{}) is much more convenient, less
tedious and even fun.

Not overloading connect() as it would be confusing to see the
receiver as first argument.

And not naming it onTimeout, as that's a popular way of doing it in
other frameworks. People would assume you could use on* with any signal.
If we ever have on* it should be all or nothing.

[ChangeLog][QtCore] Added QTimer::connectTo(), a shorthand way of
connecting to the timeout() signal.

Change-Id: Ida57e5442b13d50972ed585c3ea7be07e3d8e8d2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-25 21:17:20 +00:00
..
.gitignore Moving relevant tests to corelib/kernel 2011-09-01 12:42:14 +02:00
BLACKLIST Blacklist tst_QTimer::basic_chrono on macOS 2017-06-01 07:27:59 +00:00
qtimer.pro Clean up OS version checks for Apple platforms 2017-09-29 03:30:13 +00:00
tst_qtimer.cpp Add QTimer::connectTo(), a shorthand way of connecting to timeout() 2018-03-25 21:17:20 +00:00