Open nicolasap-dm opened 5 years ago
Some investigation on simpler pyface applications, with pypi-served pyqt5 5.7.1 vs edm-served pyqt5 5.6. Run on Ubuntu 16.04 (both vanilla, and after having installed libqt5libqgtk2
from canonical):
Everything works fine with {pip install pyqt5==5.7.1; edm install traitsui pyface
}, which brings in qt 5.7.1. The applications have a “qt native” look instead of an OS-integrated look.
I can’t seem to be able to run pip-pyqt5 with GTK+ style
Things break most of the times -- not consistently, but reliably -- with {edm install pyqt5 traitsui pyface
}, which brings qt 5.6.2. When they work, they show perfect style integration with the GTK style desktop (so non native qt style). When they don’t work, they either explode in size (pyface/examples/application/python_editor/python_editor_application.py
) or display no content (pyface/examples/python_shell.py
).
However, things work fine if the app is launched with QT_STYLE_OVERRIDE=<XXX>
(where <XXX>
can be anything, as far as I can tell). It looks like most strings (including "Breeze") give one look, and another ("Fusion") gives a different one. I'm not sure where the available options are found.
Open questions
What causes edm PyQt5 to pick up GTK+ style (which seems like a sensible choice) and pip PyQt5 to NOT choose GTK+ style? Is there a different build configuration or is it because of different pyqt/qt versions?
(Probably the latter. Changes have happened qt 5.6 → qt 5.7 with respect to styles: https://doc.qt.io/qt-5/sourcebreaks.html#changes-to-qstyle)
What causes GTK+ style to (sometimes) fail? Is this expected?
Follow up: Is there some library in the ubuntu repositories that fixes that and that can be added to the installation requirements?
Updates:
The migration to PyQt5/Qt5 seems almost straightforward after the release of pyface 6.1.1. There is a branch for the upgrade
~(note: stems from/depends on #288): diff. The branch is passing CI (I'll make a PR after #288 is merged).~
Edit: :arrow_right: Branch using qt5: #302
Unfortunately, running this on my Ubuntu 16.04 desktop causes issues, namely the main window is drawn with a window size of 16777215,16777215 (not all in one go: it starts of reasonable size, than immediately explodes). These issues are most likely related to the desktop environment and the GTK-flavored Qt style dictated by it. Indeed, this workaround works:
This blocks the migration of
force_wfmanager
but is likely an issue with PyQt5.6 (the latest available onedm
) rather than with this codebase.