Skip to content
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

Fix MainWindow inheritance #3809

Merged
merged 1 commit into from
Oct 30, 2020
Merged

Fix MainWindow inheritance #3809

merged 1 commit into from
Oct 30, 2020

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Oct 30, 2020

A change I left out of #3684 — MainWindow (and really all Qt-based classes) needs to have its Qt parent listed last in its parent class list, so that it will be the first lookup for all inherited members.

IOW,

class MainWindow(QMainWindow, UpdateWatcher):

Doesn't guarantee that super() calls will always go to the corresponding QMainWindow class members (if they're present). But,

class MainWindow(UpdateWatcher, QMainWindow):

does.

This especially matters for things like __init__ that lots of classes share, but AIUI it's also a good idea in general. Python's multiple-inheritance implementation received two massive overhauls back in the Python 3.2 - 3.4 dev cycles, before reaching its current form, and it can still be a bit shaky at times apparently.

@ferdnyc ferdnyc merged commit 3aa3c15 into develop Oct 30, 2020
@ferdnyc ferdnyc deleted the ferdnyc-patch-1 branch November 1, 2020 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant