qt5base-lts/tests/auto/widgets/kernel
Marc Mutz a7da8e0dab QWidget: cope with QObject::connect()'s incomplete SFINAE-friendliness
The plan for QObject::connect() (perfect) forwarders, such as
QWidget::addAction(), was to just use a variant of the Detection Idiom
to see whether QObject::connect() with the arguments as given would
compile and SFINAE out the forwarder otherwise.

It turns out that the "functor" overload of QObject::connect(), in
particular, is severly underconstrained and accepts e.g. QKeySequence
as a function object, only erroring out via a static_assert() in the
body of the function, and thus at instantiation time and not, as
needed, at overload resolution time.

At the same time, we don't really want QObject::connect() to SFINAE
out on argument mismatches between signal and slot, because the
resulting error messages would be ... unkind to users of the API. We
would like to keep the static_assert()s for easier error reporting.

Reconciling these two contradicting requirements has so far eluded
this author, so for now, to unblock progress, we explicitly black-
and, in one case, white-list possible arguments. Because QKeySequence,
in particular, is implicitly constructible from int(!), and therefore
any enum type(!), incl. Qt::ConnectionType, we need to do way too much
coding in the addAction() constraints. Hopefully, we'll be able to fix
the issue at the root cause, in QObject, before Qt 6.3 is out, but
until then, this is an ok-ish stop-gap measure.

Add thorough overload set checks (positive ones only, for now) to
tst_qwidget and tst_qmenu.

Change-Id: Ia05233df818bc82ecc924fc44c1b349af41cbbf1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-07-24 00:33:09 +02:00
..
qaction Remove the qmake project files 2021-01-07 15:32:28 +01:00
qactiongroup Remove the qmake project files 2021-01-07 15:32:28 +01:00
qapplication tst_qapplication: Prevent desktopaware test from deactivating main test 2021-02-15 14:20:08 +01:00
qboxlayout Remove the qmake project files 2021-01-07 15:32:28 +01:00
qformlayout Remove the qmake project files 2021-01-07 15:32:28 +01:00
qgesturerecognizer Android: unblock passing tests 2021-04-27 21:12:50 +03:00
qgridlayout Fix invalid pointer return with QGridLayout::itemAt(-1) 2021-03-22 18:47:36 +08:00
qlayout Do not remove non-widget items when removeWidget() called with nullptr 2021-05-11 16:57:17 +00:00
qshortcut Fix tsts_QShortcut::keys on Wayland 2021-03-15 08:21:40 +01:00
qsizepolicy Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstackedlayout Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtooltip Remove the qmake project files 2021-01-07 15:32:28 +01:00
qwidget QWidget: cope with QObject::connect()'s incomplete SFINAE-friendliness 2021-07-24 00:33:09 +02:00
qwidget_window Fix tst_qwidget_window::mouseMoveWithPopup on Wayland 2021-03-15 08:17:34 +01:00
qwidgetaction QWidgetAction: add test for defaultWidget() being deleted before action 2021-06-22 11:38:32 +02:00
qwidgetmetatype Remove the qmake project files 2021-01-07 15:32:28 +01:00
qwidgetsvariant Remove the qmake project files 2021-01-07 15:32:28 +01:00
qwindowcontainer Remove the qmake project files 2021-01-07 15:32:28 +01:00
CMakeLists.txt Android: blacklist a list of failing tests for android 2020-11-04 12:27:49 +02:00