Skip to content

Fix custom type saving when only focus changes for user-entered type #1147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2017
Merged

Conversation

techee
Copy link
Contributor

@techee techee commented Sep 19, 2017

At the moment when user types a custom type into the type combo box and
doesn't press enter, the entered type isn't used. This patch tries to fix
the problem by installing an event filter for the combo box and checking
when it loses focus - when it does, it performs type updates too.

On the way the patch also changes the signal used inside moveCurrentField()
from activated() to currentIndexChanged() to make it consistent with the
rest of the file.

Fixes #1144.

At the moment when user types a custom type into the type combo box and
doesn't press enter, the entered type isn't used. This patch tries to fix
the problem by installing an event filter for the combo box and checking
when it loses focus - when it does, it performs type updates too.

On the way the patch also changes the signal used inside moveCurrentField()
from activated() to currentIndexChanged() to make it consistent with the
rest of the file.
@techee
Copy link
Contributor Author

techee commented Sep 19, 2017

To workaround the missing "focus out" signal I found this:

https://stackoverflow.com/questions/321656/get-a-notification-event-signal-when-a-qt-widget-gets-focus

and using the event filter seemed to be the easiest way.

@justinclift
Copy link
Member

Awesome @techee, looks like a win. @MKleusberg will probably review this sometime today, and merge it if good. 😄

@justinclift
Copy link
Member

@MKleusberg I haven't created the 3.10.1 release yet. Is this something which should go in it?

@MKleusberg
Copy link
Member

Awesome, @techee! 👍 I can't see any problem with this. Thanks a lot 😄 If you ever feel like opening another PR you're very welcome to do so.

@justinclift Sure, why not. I'll backport it in a second.

@MKleusberg MKleusberg merged commit 969d3e4 into sqlitebrowser:master Sep 19, 2017
@MKleusberg
Copy link
Member

@justinclift Done 😄

@MKleusberg MKleusberg added the enhancement Feature requests. label Sep 19, 2017
@MKleusberg MKleusberg added this to the 3.10.1 - Gaaah! milestone Sep 19, 2017
@justinclift
Copy link
Member

@MKleusberg Awesome, thanks. 😄

I'll into the release process shortly. A bit behind schedule, but it'll still probably be today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom type isn't saved when enter isn't pressed
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy