Qt Designer Widget plugin using Python / PyQt5 on MacOS
I am having difficulty creating my custom widgets in Qt Designer specifically on my Mac.
On a windows machine using the winPython package, I can properly install the pyqt5.dll designer plugin, set PYQTDESIGNERPATH and see my custom plugins within Qt Designer.
On my mac, I have downloaded the official Mac Qt package (5.9.2); I have build from source / installed SIP/PyQt5 (5.9.2); installed the resulting pyqt5.dylib plugin; I can see the pyqt5 plugin in my Designer "About Plugins" window... however, I have no idea how to get my widget plugins to show in Qt Designer?
I export PYQTDESIGNERPATH, PYTHONPATH... from my command line env from where I launch Qt Creator / Designer, I can successfully execute the widget and plugin (ie. >>python widget.py)... so as far as I can tell my env is correct.... but nothing I do will show my custom widgets and I have no idea where to look for debugging info (I see nothing of relevance in console).
Does anyone know how to get custom python widgets to show in Designer on a Mac? Any help would be much appreciated.
Hi and welcome to devnet,
You should start Qt Creator from the command line with the
QT_DEBUG_PLUGINSenvironment variable set to 1. This will allow you to check what happening.
Thank you very much for your tip with QT_DEBUG_PLUGINS.
In the end, I needed to debug pyqt5.dylib, which showed that I was missing PyQt5.sip. Once I installed it and then put it in my PYTHONPATH, things worked.
Glad you found out and thanks for sharing your findings !
Happy coding :)