qt: Fix deprecated QCharRef usage #18101

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:20200209-deprecated-qcharref changing 1 files +1 −1
  1. hebasto commented at 5:07 pm on February 9, 2020: member

    From Qt docs:

    Return values when modifier keys such as Shift, Control, Alt, and Meta are pressed differ among platforms and could return an empty string.

    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.

  2. qt: Fix deprecated QCharRef usage ac57859e53
  3. DrahtBot added the label GUI on Feb 9, 2020
  4. brakmic commented at 5:42 pm on February 9, 2020: contributor
    Concept ACK.
  5. brakmic approved
  6. brakmic commented at 5:46 pm on February 9, 2020: contributor
    Tested on macOS Catalina 10.15.3 with Qt 5.14.1
  7. jonasschnelli approved
  8. jonasschnelli commented at 5:54 pm on February 9, 2020: contributor
    utACK ac57859e53167f4ff3da467b616b0902c93701a9
  9. hebasto commented at 6:57 pm on February 9, 2020: member

    @brakmic

    Tested on macOS Catalina 10.15.3 with Qt 5.14.1

    Thank you for your review and testing.

    Usually, when a reviewer approves PR, he starts his message with ACK top_commit_hash ;)

  10. in src/qt/splashscreen.cpp:140 in ac57859e53
    136@@ -137,7 +137,7 @@ SplashScreen::~SplashScreen()
    137 bool SplashScreen::eventFilter(QObject * obj, QEvent * ev) {
    138     if (ev->type() == QEvent::KeyPress) {
    139         QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev);
    140-        if(keyEvent->text()[0] == 'q') {
    141+        if (keyEvent->key() == Qt::Key_Q) {
    


    laanwj commented at 11:28 am on February 10, 2020:

    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.

  11. laanwj referenced this in commit 9e77726fb7 on Feb 10, 2020
  12. laanwj merged this on Feb 10, 2020
  13. laanwj closed this on Feb 10, 2020

  14. hebasto deleted the branch on Feb 10, 2020
  15. MarkLTZ referenced this in commit d99bc96496 on Feb 13, 2020
  16. deadalnix referenced this in commit 227a327fd9 on Dec 22, 2020
  17. PastaPastaPasta referenced this in commit 4efc842eba on Jun 27, 2021
  18. PastaPastaPasta referenced this in commit 06a08d3cb5 on Jun 28, 2021
  19. PastaPastaPasta referenced this in commit 5b21767e40 on Jun 29, 2021
  20. PastaPastaPasta referenced this in commit dfddbc81df on Jul 1, 2021
  21. PastaPastaPasta referenced this in commit 5cfdaa18d5 on Jul 1, 2021
  22. PastaPastaPasta referenced this in commit f2cd8c9da0 on Jul 14, 2021
  23. PastaPastaPasta referenced this in commit c90a5fddb4 on Jul 14, 2021
  24. PastaPastaPasta referenced this in commit 2a3fa63dc1 on Jul 15, 2021
  25. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me