change the libOrder to favor Qt6#2157
change the libOrder to favor Qt6#2157j9ac9k merged 16 commits intopyqtgraph:masterfrom Wubbzi:binding_load_order
Conversation
|
If you make this change, you may also want to modify the drop-down list in |
|
@pijyoi I could do that. Could we get rid of 'default' too? The UX could be better if we set the index to the correct version in ExampleApp before the launch. |
|
Sure. But correct version means matching it against PYQTGRAPH_QT_LIB and also the bindings that are found to be installed. |
pyqtgraph/examples/ExampleApp.py
Outdated
| from collections import OrderedDict | ||
| from functools import lru_cache | ||
|
|
||
| import pkg_resources |
There was a problem hiding this comment.
Can it be assumed that this is available for use?
There was a problem hiding this comment.
Not as sure as I am about pkgutil so we can use that with minimal changes instead of pkg_resources.
pyqtgraph/examples/ExampleApp.py
Outdated
|
|
||
| def showEvent(self, event) -> None: | ||
| super(ExampleLoader, self).showEvent(event) | ||
| disabledColor = pg.mkColor(QtCore.Qt.GlobalColor.red) |
There was a problem hiding this comment.
may I suggest that this PR not change the public API at the same time?
QtGui.QColor(QtCore.Qt.GlobalColor.red) would seem to suffice.
|
So the original code populates the combo box through the And going even further, why not just populate the combo box only with the bindings that are available? Of course, showing the not available bindings does give an indication to the user that pyqtgraph works with multiple bindings. |
There isn't a good reason that I can think of for us not to do it this way. I'm pretty sure it would only be 1 line. edit: I went ahead and did this, if for no other reason than it will be easier to change/update in the future.
Before marking the missing bindings in red, I was removing them, but like you said, a user might not know they have the option of using other bindings. I think this is the better option. The one thing I'm not sure about is disabling the binding in addition to coloring it red. I think most people will understand it means the binding isn't installed, but maybe it would be better to mark the binding in red and not disable it, so they can see the traceback when an example is run. |
…d item when launched
…ge the color, and set a tooltip on that item in the combobox.
…time and when font size is changed.
|
Hi @Wubbzi, hope you don't mind that I took over this PR, I really wanted this diff in 0.13.0 release; but there were a number of merge conflicts. Thanks for the PR! |

I'd like to propose changing the order in which Qt bindings are selected when one is not specified by the user.
Changing the
libOrderto favor the newer Qt6 bindings is inevitable and I think now is as good of a time as any to do it.Pros
Cons
PYQTGRAPH_QT_LIBif this does happen to users with multiple versions of bindings)Does anyone have a preference on the order of the v6 bindings? Right now, both versions have about the same number of users going based on the downloads.
https://pypistats.org/packages/pyside6
https://pypistats.org/packages/pyqt6