summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <[email protected]>2025-01-13 10:36:56 +0100
committerVolker Hilsheimer <[email protected]>2025-01-14 00:39:48 +0100
commit20a401cd9ff3d083d60fd7cea4416b8a54ee5753 (patch)
tree4ef392a3d6ee7c12bbf174301d1b97946f32c482
parent95abc38ba6e586c8e491593ebe4c4b4ee32a79e7 (diff)
QTestLib: handle all Qt::Key values in keyToAscii
Since the function is implemented to return 0 for many non-alpha-numeric keys already, make that the default implementation and remove the Q_ASSERT(false). Instead, emit a warning. Amends 1a820560000c7669812de9e2283a539118b24e51, after which the QQuickShortCut test in Qt Quick trips the assert. Change-Id: I6c6ac0a80043c1bbb7683bc47c1092a12b9cf230 Reviewed-by: Vlad Zahorodnii <[email protected]> Reviewed-by: Jules Bertholet <[email protected]> Reviewed-by: Shawn Rutledge <[email protected]>
-rw-r--r--src/testlib/qasciikey.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/testlib/qasciikey.cpp b/src/testlib/qasciikey.cpp
index 114b757dc4b..b9e68602958 100644
--- a/src/testlib/qasciikey.cpp
+++ b/src/testlib/qasciikey.cpp
@@ -467,7 +467,9 @@ char QTest::keyToAscii(Qt::Key key)
case Qt::Key_Yes : return 0; // = 0x01010001
case Qt::Key_No : return 0; // = 0x01010002
- default: QTEST_ASSERT(false); return 0;
+ default:
+ qWarning() << __FUNCTION__ << "Unhandled key code" << key;
+ return 0;
}
}