-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Toggle file switcher when pressing its keyboard shortcut #3313
Conversation
if self.fileswitcher_dlg is not None and \ | ||
self.fileswitcher_dlg.is_visible: | ||
self.fileswitcher_dlg.hide() | ||
self.fileswitcher_dlg.is_visible = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already supported by Qt, with the visible
property. See http://doc.qt.io/qt-4.8/qwidget.html#visible-prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops, I didn't know about it. I looked for isVisible
but it seems QDialogs don't support it.
I'll change it in master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work with Qt5, so it was probably only available with Qt4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'll leave things as they are ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still present in Qt5: http://doc.qt.io/qt-5.6/qwidget.html#visible-prop (and QDialog inherits QWidget). So it should work...
Anyway it's not a big deal, this comment is for completeness only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use visible
, believe me ;-) It just didn't work, I don't know why...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found why. The widget is created on demand, and during initialization the widget is not visible yet so a check with visible()
will be wrong. Your code is as good as any other workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good to know ;-)
Fixes #3297