diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-02-10 12:29:46 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-02-10 12:30:28 +0100 |
commit | 9e77726fb7371022862449ab35f3d7f7eac223eb (patch) | |
tree | e325bb7432f76148015a1cf1f63b8ef9a2195b0e /src/qt | |
parent | 407d7c831aab92aaf80b1d7609835347bd72011a (diff) | |
parent | ac57859e53167f4ff3da467b616b0902c93701a9 (diff) |
Merge #18101: qt: Fix deprecated QCharRef usage
ac57859e53167f4ff3da467b616b0902c93701a9 qt: Fix deprecated QCharRef usage (Hennadii Stepanov)
Pull request description:
From Qt docs:
- [`QKeyEvent::text()`](https://doc.qt.io/qt-5/qkeyevent.html#text):
> Return values when modifier keys such as Shift, Control, Alt, and Meta are pressed differ among platforms and could return an empty string.
- [`QString::operator[]()`](https://doc.qt.io/qt-5/qstring.html#operator-5b-5d):
> **Note:** Before Qt 5.14 it was possible to use this operator to access a character at an out-of-bounds position in the string, and then assign to such a position, causing the string to be automatically resized. Furthermore, assigning a value to the returned `QCharRef` would cause a detach of the string, even if the string has been copied in the meanwhile (and the `QCharRef` kept alive while the copy was taken). These behaviors are deprecated, and will be changed in a future version of Qt.
Since Qt 5.14 this causes a `QCharRef` warning if any modifier key is pressed while the splashscreen is still displayed.
Fix #18080.
Note: Ctrl+Q will also close the spashscreen now.
ACKs for top commit:
jonasschnelli:
utACK ac57859e53167f4ff3da467b616b0902c93701a9
Tree-SHA512: a7e5559410bd05c406007ab0243f458b82d434b0543276ed331254c8d7a6b1aaa54d0b406f799b830859294975004380160f8af04ba403d3bf185d51e6784f54
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/splashscreen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index e19833019d..e4ffa6cd9a 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -137,7 +137,7 @@ SplashScreen::~SplashScreen() bool SplashScreen::eventFilter(QObject * obj, QEvent * ev) { if (ev->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev); - if(keyEvent->text()[0] == 'q') { + if (keyEvent->key() == Qt::Key_Q) { m_node.startShutdown(); } } |