-
Notifications
You must be signed in to change notification settings - Fork 253
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
Remap setSectionResizeMode to Qt 4 #112
Conversation
…somehow causes this to not work as one would expect.
This works now, but there is a problem. Importing PySide before Qt.py under Python 3 has side-effects which prevents the remapping from taking place. This may be due to some of the magic happening upon importing PySide and I'm expecting this to be outside of our control. The exposing lines are here, remapping is here. This makes monkey-patching classes a non-starter. |
Here's an alternative, to subclass rather than monkey-patch. The problem in this case is that the function A fact easily proven via: id(qheaderview) != id(QtWidgets.QHeaderView) This makes subclassing for filling in missing functionality in older bindings a non-starter as well. Due to these findings, and unless anyone has an alternative implementation to share, this cannot be merged. :( |
Here's a third alternative from qtpy; also monkey-patching the class. |
Important lessons learned here are:
Closing this, and will refer back here whenever any of these two solutions crop up in pull-requests. |
Due to the PR coming from a master branch, rather than a feature branch, I've force-pushed it back to it's original state and stored these changes for future reference in an alternative branch. |
Goal
Enable Qt 4 bindings the use of
setSectionResizeMode
.Rationale
Originally offered here but through misunderstandings it never saw the light of day.
This enables a PyQt5/PySide2 implementation to run on PyQt4/PySide, without altering the behavior of those bindings.
Implementation
A simple remapping. See the test and implementation for details!
@fredrikaverpil let me know what you think.