Convert Qt Enums to Qt6 Namespace#1818
Conversation
| QtGui.QPainter.CompositionMode.CompositionMode_Plus Both the alpha and color of the image and background pixels | ||
| are added together. | ||
| QtGui.QPainter.CompositionMode_Multiply The output is the image color multiplied by the background. | ||
| QtGui.QPainter.CompositionMode.CompositionMode_Multiply The output is the image color multiplied by the background. |
There was a problem hiding this comment.
These seem to break the docstring alignment.
There was a problem hiding this comment.
ooooooooof... yea I'm going to have to take a closer look at those :|
|
PyQtEnumConverter should not be run on the generated *Template_{binding}.py files. |
yuuuup... just realized that 🤦🏻 |
|
You might as well remove the following chunk from Qt.py if QT_LIB == PYQT6:
# shim the old names for QPointF mouse coords
QtGui.QSinglePointEvent.localPos = lambda o : o.position()
QtGui.QSinglePointEvent.windowPos = lambda o : o.scenePosition()
QtGui.QSinglePointEvent.screenPos = lambda o : o.globalPosition()
QtWidgets.QApplication.exec_ = QtWidgets.QApplication.execSince PySide6 6.1.0, use of localPos, windowPos, screenPos, exec_ generates a deprecation warning. The codebase has since been changed to use the following style: |
Qt6 <= 6.0.3 had a soft memory leak for every queued signal emitted. This makes it unsuitable for long running applications. Since PyQt6 didn't release a 6.0.4, it means that to get the fix for this bug, you need PyQt6 >= 6.1.0. That should be good enough a reason to move to 6.1. This memory leak is actually quickly visible in the various SpeedTest examples where a QTimer is being fired as fast as possible. |
fbbb748 to
f3c5c9f
Compare
|
The intermittent segfault I'm seeing on pyside2/python3.7 has me concerned. I think at this point everything else should be good. |
|
DateAxisItem_QtDesigner.ui and designerExample.ui are loaded during runtime, so don't generate files for them. |
738025d to
888ece9
Compare
|
I'm going to call it a night; will try some more trial and error regarding the segfault tomorrow. Thanks for looking this over @pijyoi @NilsNemitz |
f0037f2 to
0f38b14
Compare
b6568b5 to
084f0f3
Compare
|
my git game is weak; I keep running into this silly conflict, eventually I'll figure out how to resolve it... |
|
Doing a search for Ok, calling it a night this time for sure. |
bb835d7 to
73c56d4
Compare
|
Well, an identical segfault occurred in an unrelated PR and given this PR hasn't merged, I'm now confident in saying this segfault is not the result of this PR. https://github.com/pyqtgraph/pyqtgraph/pull/1726/checks?check_run_id=2764478711 |
Yes. ROI.py has special handling for KeyboardModifiers for PyQt6 6.0.x RemoteGraphicsView.py and ndarray_to_qimage have special handling for QImage for PyQt6 6.0.0 |
abd68f5 to
2612209
Compare
This namespace appears to be valid in PySide2/PyQt5 5.12+ so we may as well migrate to the newer namespace ourselves.
Simplify some PyQt6 code branches
Update PySide6 templates to Qt 6.1
This has been demonstrated to not work in PyQt6.
There seems to be some unintentional side effect when running examples and the same time. This change breaks up the execution into two separate calls to pytest in an attempt to bypass whatever issue is being created.
|
Sorry for the huge diff, let's hope the merge conflicts aren't too bad! |
|
@j9ac9k , I think there are 3 instances of |
you're right... have some work to do tonight will try and get to this in the next day or so. |
While doing benchmarking for #1796 I noticed on PyQt6 bindings, a lot of time was being spent shuffling the Enum namespace during the initialization while loading Qt.py. The benchmark I used was to update the line plot 500 times. 43% of the runtime was spent in
Qt.py, of which promote_enums consumed 38% of the overall runtime. Attached is the output of of the call-graph.It was brought to my attention by @The-Compiler that the Qt6 Enum namespace has been present in Qt5 from at least Qt 5.12; and after doing some testing, sure enough it was; so decided a migration was in order.
The fantastic PyQtEnumConverter library handled the bulk of the work. It missed a lot of cases of
self.EnumValue, but luckily the test suite was more than happy to error out along the way. As I patched known issues in the test suite, I used my editors "find all" functionality to find other usages of those particular enums to try and convert cases that the test suite had no coverage of. I think I got them all at this point.Lastly, I took the opportunity to remove Qt 6.0 support from the README and some of the specific shims we had in place for it. I have a hard time imagining what a use-case for someone needing Qt 6.0 support when 6.1 is released.
Sorry for the huge diff, I don't mean to give everyone head-aches with merge-conflicts.
tagging @pijyoi due to their work in making the enum namespace equivalent; figure you may have some input
Looking through the diff before I hit submit, I see one of my changes in MultiPlotSpeedTest.py got caught up. I don't mind restoring it if it would make people feel better.