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

Backend refactor qt #5

Open
wants to merge 10 commits into
base: backend-refactor
Choose a base branch
from
Open

Conversation

tacaswell
Copy link

No description provided.

@@ -442,6 +464,52 @@ def closeEvent(self, event):
QtWidgets.QMainWindow.closeEvent(self, event)


class Window(WindowBase, MainWindow):
def __init__(self, title):
WindowBase.__init__(self, title)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to be subtle to get right because some versions of pyqt do not user super and some do. This will probably need some conditional logic based on pyqt version.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, thanks for the heads-up. I think see the problem. It works fine so long as we don't extend WindowQt5 and then super will break... just found the perfect solution to this, just returned to the article I began reading the other day, and they have the solution.

https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ (see How to Incorporate a Non-cooperative Class). As far as I can see, we can apply the adapter pattern directly in qt_compat.py.

Anyway, will look into this deeper once we have the main MEP27 branch merged and turn our focus onto the individual backends.

P.S. Sorry for the delay, turning email notifications off for PRs where I haven't had a mention seems to also not email about me about PRs...

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.

2 participants