qt: Fix deprecated QCharRef usage#18101
Merged
laanwj merged 1 commit intobitcoin:masterfrom Feb 10, 2020
Merged
Conversation
Contributor
|
Concept ACK. |
brakmic
approved these changes
Feb 9, 2020
Member
Author
Thank you for your review and testing. Usually, when a reviewer approves PR, he starts his message with |
laanwj
reviewed
Feb 10, 2020
| if (ev->type() == QEvent::KeyPress) { | ||
| QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev); | ||
| if(keyEvent->text()[0] == 'q') { | ||
| if (keyEvent->key() == Qt::Key_Q) { |
Member
There was a problem hiding this comment.
I think this slightly changes the behavior from accepting 'q' to 'q' and 'Q' (shift-q). But I'm fine with this, personally.
edit: oh, also ctrl-Q, as you mention in the PR desc.
laanwj
added a commit
that referenced
this pull request
Feb 10, 2020
ac57859 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 ac57859 Tree-SHA512: a7e5559410bd05c406007ab0243f458b82d434b0543276ed331254c8d7a6b1aaa54d0b406f799b830859294975004380160f8af04ba403d3bf185d51e6784f54
MarkLTZ
added a commit
to litecoinz-core/litecoinz
that referenced
this pull request
Feb 13, 2020
- [0.19] wallet: Reset reused transactions cache bitcoin#18083 - 0.19: Backports bitcoin#17792 - psbt: handle unspendable psbts bitcoin#17524 - qt: Fix comparison function signature bitcoin#17634 - psbt: check that various indexes and amounts are within bounds bitcoin#17156 - [0.19] psbt: check that various indexes and amounts are within bounds bitcoin#18079 - [0.19] Final backports for 0.19.1 bitcoin#17988 - Bug: IsUsedDestination shouldn't use key id as script id for ScriptHash bitcoin#17924 - qt: Fix deprecated QCharRef usage bitcoin#18101 - gui: Throttle GUI update pace when -reindex bitcoin#18121 - gui: Fix race in WalletModel::pollBalanceChanged bitcoin#18123 - gui: Fix unintialized WalletView::progressDialog bitcoin#18062 - Bugfix: GUI: Hide the HD/encrypt icons earlier so they get re-shown if another wallet is open bitcoin#18007 - bug-fix macos: give free bytes to F_PREALLOCATE bitcoin#17887 - test: add missing #include to fix compiler errors bitcoin#17980 - zmq: Fix due to invalid argument and multiple notifiers bitcoin#17445
deadalnix
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Dec 22, 2020
Summary: This change prevent a `QCharRef` deprecation warning if any modifier key is pressed while the spashscreen is still displayed, for Qt >= 5.14. As a side effect, Ctrl+Q and Shift+Q will also close the splashscreen now. This is a backport of core [[bitcoin/bitcoin#18101 | PR18101]] Test Plan: `ninja && src/qt/bitcoin-qt -regtest` Press Q, or Ctrl+Q or Shift+Q while on the splashscreen. Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8741
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jul 1, 2021
ac57859 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 bitcoin#18080. Note: Ctrl+Q will also close the spashscreen now. ACKs for top commit: jonasschnelli: utACK ac57859 Tree-SHA512: a7e5559410bd05c406007ab0243f458b82d434b0543276ed331254c8d7a6b1aaa54d0b406f799b830859294975004380160f8af04ba403d3bf185d51e6784f54
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jul 15, 2021
ac57859 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 bitcoin#18080. Note: Ctrl+Q will also close the spashscreen now. ACKs for top commit: jonasschnelli: utACK ac57859 Tree-SHA512: a7e5559410bd05c406007ab0243f458b82d434b0543276ed331254c8d7a6b1aaa54d0b406f799b830859294975004380160f8af04ba403d3bf185d51e6784f54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From Qt docs:
QKeyEvent::text():QString::operator[]():Since Qt 5.14 this causes a
QCharRefwarning if any modifier key is pressed while the splashscreen is still displayed.Fix #18080.
Note: Ctrl+Q will also close the spashscreen now.