Qt: Don't crash when pressing the Return key#6099
Merged
leoetlino merged 1 commit intodolphin-emu:masterfrom Oct 11, 2017
Merged
Qt: Don't crash when pressing the Return key#6099leoetlino merged 1 commit intodolphin-emu:masterfrom
leoetlino merged 1 commit intodolphin-emu:masterfrom
Conversation
spycrab
approved these changes
Oct 4, 2017
Contributor
|
On macOS, this no longer handles |
Contributor
|
I love this bug. |
Member
Author
|
Ugh, looks like Qt item views don't emit the https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/itemviews/qabstractitemview.cpp?h=5.5#n2389 |
Member
Author
|
Changed the fix to just check whether a game is selected or not before emitting the signal. |
ligfx
approved these changes
Oct 10, 2017
gshakhn
added a commit
to gshakhn/keepassxc
that referenced
this pull request
Sep 26, 2018
* Override `keyPressEvent`on WelcomeWidget on OS X to `openDatabaseFromFile`. openDatabaseFromFile is already invoked via the QListWidget::itemActivated signal, but this signal doesn't fire on OS X for Enter. QListWidget::itemActivated activates on an OS specific activation key. [1] On Windows/X11, this is Enter, which lets the user easily navigate with just the keyboard. On OS X, this is Ctrl+O, which is already bound to Open Database. This means that itemActivated cannot fire via the keyboard. Per StackOverflow [2], the recommended solution is to catch the enter/return key press manually. This seems like a common problem with Qt. [3] [4] [1] https://doc.qt.io/archives/qt-4.8/qlistwidget.html#itemActivated [2] https://stackoverflow.com/questions/31650780/when-does-a-qtreeview-emit-the-activated-signal-on-mac [3] https://forum.qt.io/topic/36147/pyside-itemactivated-not-triggered-on-mac-os-x-with-return-key [4] dolphin-emu/dolphin#6099
gshakhn
added a commit
to gshakhn/keepassxc
that referenced
this pull request
Sep 26, 2018
* Override `keyPressEvent`on WelcomeWidget on OS X to `openDatabaseFromFile`. openDatabaseFromFile is already invoked via the QListWidget::itemActivated signal, but this signal doesn't fire on OS X for Enter. QListWidget::itemActivated activates on an OS specific activation key. [1] On Windows/X11, this is Enter, which lets the user easily navigate with just the keyboard. On OS X, this is Ctrl+O, which is already bound to Open Database. This means that itemActivated cannot fire via the keyboard. Per StackOverflow [2], the recommended solution is to catch the enter/return key press manually. This seems like a common problem with Qt. [3] [4] [1] https://doc.qt.io/archives/qt-4.8/qlistwidget.html#itemActivated [2] https://stackoverflow.com/questions/31650780/when-does-a-qtreeview-emit-the-activated-signal-on-mac [3] https://forum.qt.io/topic/36147/pyside-itemactivated-not-triggered-on-mac-os-x-with-return-key [4] dolphin-emu/dolphin#6099
droidmonkey
pushed a commit
to gshakhn/keepassxc
that referenced
this pull request
Dec 25, 2018
* Override `keyPressEvent`on WelcomeWidget on OS X to `openDatabaseFromFile`. openDatabaseFromFile is already invoked via the QListWidget::itemActivated signal, but this signal doesn't fire on OS X for Enter. QListWidget::itemActivated activates on an OS specific activation key. [1] On Windows/X11, this is Enter, which lets the user easily navigate with just the keyboard. On OS X, this is Ctrl+O, which is already bound to Open Database. This means that itemActivated cannot fire via the keyboard. Per StackOverflow [2], the recommended solution is to catch the enter/return key press manually. This seems like a common problem with Qt. [3] [4] [1] https://doc.qt.io/archives/qt-4.8/qlistwidget.html#itemActivated [2] https://stackoverflow.com/questions/31650780/when-does-a-qtreeview-emit-the-activated-signal-on-mac [3] https://forum.qt.io/topic/36147/pyside-itemactivated-not-triggered-on-mac-os-x-with-return-key [4] dolphin-emu/dolphin#6099
droidmonkey
pushed a commit
to keepassxreboot/keepassxc
that referenced
this pull request
Dec 25, 2018
* Override `keyPressEvent`on WelcomeWidget on OS X to `openDatabaseFromFile`. openDatabaseFromFile is already invoked via the QListWidget::itemActivated signal, but this signal doesn't fire on OS X for Enter. QListWidget::itemActivated activates on an OS specific activation key. [1] On Windows/X11, this is Enter, which lets the user easily navigate with just the keyboard. On OS X, this is Ctrl+O, which is already bound to Open Database. This means that itemActivated cannot fire via the keyboard. Per StackOverflow [2], the recommended solution is to catch the enter/return key press manually. This seems like a common problem with Qt. [3] [4] [1] https://doc.qt.io/archives/qt-4.8/qlistwidget.html#itemActivated [2] https://stackoverflow.com/questions/31650780/when-does-a-qtreeview-emit-the-activated-signal-on-mac [3] https://forum.qt.io/topic/36147/pyside-itemactivated-not-triggered-on-mac-os-x-with-return-key [4] dolphin-emu/dolphin#6099
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use the "activated" signal instead of manually detecting key presses.
Handles both double clicks and Return presses, and fixes a bug in the
logic which could cause GameSelected to be emitted without any game.