qt6-bb10/tests/auto
Giuseppe D'Angelo 6e2c9dc7a6 QKeyCombination: move the operators into namespace Qt
QKeyCombination comes with a few operators that combine a Qt::Modifier
and a Qt::Key. These operators are normally defined in Qt's own
namespace (which by default is the global namespace), but indeed the
arguments are declared in the (nested) namespace `Qt`. This is wrong,
as their lookup will fail if a user places an unrelated operator| in
a custom namespace U and then tries to use QKeyCombination's operators:
the overload in namespace U will hide the ones defined globally;
unqualified lookup (as per [over.match.oper]) will search in the
namespaces associated with the parameters (QtNamespace::Qt), but the
operators are *not* in there!

In other words:

namespace NS {
  X operator|(Y, Z);
  auto kc = Qt::Shift | Qt::Key_A;
}

fails to compile if QKeyCombination's operator| is *not* defined in the
`Qt` namespace.

Fix this by indeed defining the operator where it belongs. The functions
are all inline and non-exported so there should not be any ABI issues.

Change-Id: I6d7a4e976fb109b7bf514011142b9a9573e507c5
Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-126820
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1f77e8566f71d98f4bc6bbf5092594e67a32f268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-31 15:21:36 +00:00
..
bic/data Add binary compatibility file for 6.7.0 2024-04-17 10:18:37 +00:00
cmake Use add_compile_definitions instead of add_definitions 2024-07-05 15:55:31 +00:00
concurrent tst_QtConcurrentThreadEngine: fix UB (uninitialized boolean) 2024-07-06 10:17:50 +00:00
corelib QKeyCombination: move the operators into namespace Qt 2024-07-31 15:21:36 +00:00
dbus QDBusSignature: accept empty strings as valid 2024-05-10 13:17:20 -07:00
gui tests: skip tst_QWindow::framePositioning() on Wayland 2024-07-25 20:06:41 +00:00
guiapplauncher Convert "Color Editor Factory" Example to snippets 2024-04-19 13:39:41 +02:00
network tst_http2: stabilize duplicateRequestsWithAborts for macos 2024-07-22 14:47:51 +00:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other Fix accessibility of list views with underlying multi-column model 2024-06-26 22:52:30 +00:00
printsupport PDF: add support for PDF/X-4 2024-07-08 12:46:00 +00:00
shared Introduce flag to use typographical line metrics for fonts 2024-05-31 19:30:53 +02:00
sql SQL/QSqlRelationTableModel: don't crash with more than one relation 2024-07-22 21:00:12 +00:00
testlib tst_selftest: port away from qsnprintf() 2024-07-30 16:47:38 +00:00
tools tst_macdeployqt: Only pass -use-debug-libs for debug-and-release builds 2024-07-19 13:42:22 +00:00
wasm Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
widgets Blacklist: tst_QGraphicsAnchorLayout::layoutDirection for Ubuntu 24.04 2024-07-29 11:12:41 +00:00
xml Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
CMakeLists.txt tst_QSettings: port to QTEST_THROW_ON_FAIL 2024-06-27 06:06:02 +00:00
network-settings.h Change license for tests files 2024-02-04 09:56:42 +01:00