Absolute beginner
-
I have forked an open-source project written in Python which uses Qt 5 to provide the GUI goodness. I want to make some changes to the GUI stuff (move some of the main dialog into a tab, clone the tab, make some changes in the clone, have the clone run new bits of code).
I could just edit the main_dialog.ui file and bodge my way through duplicating chunks of XML, adding some widgety bits, renaming stuff, and keep my fingers crossed when running pyuic. But this is 2019, not 1985 so there must be a better, easier way.
I guess it would be to use QT Designer. But I can't find a way to install it. Remember: absolute beginner here. DDG finds several quick tutorials along the lines of
setup a Python 3.6 venv pip install pyqt5 pip install pyqt5-tools (or possibly) pip install pyqt5designer
Pip is happy to install pyqt5 but doesn't want to know about pyqt5-tools or pyqt5-designer:
(venv) mark@avm:~/tmp/pyqtest$ pip install pyqt5-tools ERROR: Could not find a version that satisfies the requirement pyqt5-tools (from versions: none) ERROR: No matching distribution found for pyqt5-tools (venv) mark@avm:~/tmp/pyqtest$ pip install pyqt5-designer ERROR: Could not find a version that satisfies the requirement pyqt5-designer (from versions: none) ERROR: No matching distribution found for pyqt5-designer
So can someone please explain what I need to do to go from a clean ubuntu18 install to being able to run some GUI design tool and convert the resulting .ui file into a .py which will play nicely with the rest of my project?
Thanks in advance.
-
Hi and welcome to devnet,
The most simple and straightforward way would be to install the Qt 5 tools from your distribution. Use apt and install the
qttools5-dev-tools
package. -
@walkjivefly said in Absolute beginner:
pip install pyqt5-tools
Have a read through https://stackoverflow.com/questions/42090739/pyqt5-how-to-start-the-designer, especially the accepted solution which is most up-to-date. Looks like it's problematic from PyQt 5.7+? You may be best following @SGaist's advice to do it via
apt install
, outside of your virtual environment?Otherwise sign up to the PyQt mailing list via https://riverbankcomputing.com/mailman/listinfo/pyqt and ask there. They will tell you the definitive on all things PyQt.
-
Thank you both for the replies. The PyPi approach doesn't work but @SGaist suggestion was spot on!
Designer ran, changes made, pyuic5 generated a .py from the updated .ui and I'm onto the next stage. Thanks again.