From be4333c4c66b33911bf5e8761c4aa27e2fe4c4a1 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Fri, 7 Jul 2023 05:36:51 +0200 Subject: [PATCH] qt: Fix deprecated QCharRef usage Port https://github.com/bitcoin/bitcoin/pull/18101 to our codebase. Without this commit every Alt-Tab or other keypress on the SplashScreen will lead to the following message in debug.log: GUI: Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt. --- src/qt/splashscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 9cb0feb8..4c21c59d 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -144,7 +144,7 @@ SplashScreen::~SplashScreen() bool SplashScreen::eventFilter(QObject * obj, QEvent * ev) { if (ev->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(ev); - if(keyEvent->text()[0] == 'q') { + if (keyEvent->key() == Qt::Key_Q) { StartShutdown(); } }