You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some circumstances it may be useful to specify the Qt version qtpy should use without without specifying which implementation to use. Currently it is only possible leave it up to qtpy to decide or to exactly specify the API using the QT_API environment variable.
In my particular use case I would need this feature in an application using QtPdf (which is only available in Qt6) but am indifferent whether PyQt6 or PySide6 should be used. I am aware that it is possible to set QT_API=pyqt6 and pyqt will fall back to PySide6 when PyQt6 is not available but I would consider this a bit unsatisfactory since it will trigger a warning for an unproblematic case, the actual intention does not become clear when looking at the code and it does not work when only Qt5 should be used instead.
This feature could be realized by allowing to set QT_API to a Qt version , e.g. QT_API=Qt6 or by allowing to set QT_API to a list of values, e.g. QT_API=pyqt6,pyside6.
The text was updated successfully, but these errors were encountered:
Hey @Bzero, thanks for reporting. I think it'd better to create a new env var for this case because QT_API is used by other packages (e.g. Matplotlib and Qtconsole, if I'm not mistaken). So, we could have QT_VERSION=qt6, which is similar to what you suggested.
Thanks for your reply. I was not aware that QT_API is used by other packages too so I agree that adding a QT_VERSION environment variable makes sense.
The only drawback I see with this is that QT_API and QT_VERSION may be in conflict with each other, I suppose in that case qtpy should probably just ignore QT_VERSION and trigger a warning.
The only drawback I see with this is that QT_API and QT_VERSION may be in conflict with each other, I suppose in that case qtpy should probably just ignore QT_VERSION and trigger a warning.
Agreed. QT_API should have precedence over QT_VERSION and we should report a warning about it. Also, another warning should be shown if the QT_VERSION value can't be set because there are no matching bindings.
dalthviz
changed the title
Allow to specify Qt Version via Environemt Variable
Allow to specify Qt version via an environment variable (QT_VERSION)
Apr 9, 2024
In some circumstances it may be useful to specify the Qt version
qtpy
should use without without specifying which implementation to use. Currently it is only possible leave it up toqtpy
to decide or to exactly specify the API using theQT_API
environment variable.In my particular use case I would need this feature in an application using
QtPdf
(which is only available in Qt6) but am indifferent whetherPyQt6
orPySide6
should be used. I am aware that it is possible to setQT_API=pyqt6
andpyqt
will fall back toPySide6
whenPyQt6
is not available but I would consider this a bit unsatisfactory since it will trigger a warning for an unproblematic case, the actual intention does not become clear when looking at the code and it does not work when onlyQt5
should be used instead.This feature could be realized by allowing to set
QT_API
to a Qt version , e.g.QT_API=Qt6
or by allowing to setQT_API
to a list of values, e.g.QT_API=pyqt6,pyside6
.The text was updated successfully, but these errors were encountered: