Skip to content

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

Merged
MKleusberg merged 1 commit into
sqlitebrowser:masterfrom
techee:save_fix
Sep 19, 2017
Merged

MKleusberg merged 1 commit into
sqlitebrowser:masterfrom
techee:save_fix

Conversation

@techee

@techee techee commented Sep 19, 2017

Copy link
Copy Markdown
Contributor

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

techee commented Sep 19, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

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

@justinclift

Copy link
Copy Markdown
Member

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

@MKleusberg

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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