path: root/src/testlib/qtestkeyboard.h
diff options
authorEdward Welbourne <>2021-09-21 16:30:03 +0200
committerEdward Welbourne <>2021-09-23 16:57:03 +0200
commit5b525e8e54384600b92415b08b5ec94020faf40c (patch)
tree6c5a1d96f2fb22dc5b55cca01ef6bb49d1a90378 /src/testlib/qtestkeyboard.h
parent8511c8b02fded7e3d698e38798aff1334bd38da6 (diff)
Replace QTest::qWarn() with qWarning()
It's the recommended replacement when file and line aren't known, and simplifies the code in any case, thanks to taking format and varargs. It incidentally also enables tests to tell QtTest's custom message logger to anticipate its warnings, when they arise. Fixes: QTBUG-67702 Change-Id: I10c883f4dd0b69dca6e59e0dbd55ab318f1938f4 Reviewed-by: Mitch Curtis <> Reviewed-by: Shawn Rutledge <> Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/testlib/qtestkeyboard.h')
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h
index 1c1b676e70..84b3e3f3c4 100644
--- a/src/testlib/qtestkeyboard.h
+++ b/src/testlib/qtestkeyboard.h
@@ -1,6 +1,6 @@
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact:
** This file is part of the QtTest module of the Qt Toolkit.
@@ -197,7 +197,7 @@ namespace QTest
if (press && qt_sendShortcutOverrideEvent(widget, a.timestamp(), code, modifier, text, repeat))
if (!qApp->notify(widget, &a))
- QTest::qWarn("Keyboard event not accepted by receiving widget");
+ qWarning("Keyboard event not accepted by receiving widget");
static void sendKeyEvent(KeyAction action, QWidget *widget, Qt::Key code,