Open Woutah opened 2 years ago
Same issue here. Also on Windows, same version of PyQt5 and pyqt5-tools but with python 3.9. --test-exception-dialog doesn't do anything either. Setting PYQTDESIGNERPATH to a directory with plugins doesn't have any effect either, except that a pycache directory shows up after launching Qt designer but no widgets show up. The Help -> About Plugins shows that pyqt5.dll is loaded but I can't get any widgets to show up.
I got it to work by changing this line:
File: site-packages\pyqt5-plugins\examplebuttonplugin.py
major = int(pkg_resources.get_distribution(__name__.partition('.')[0]).version.partition(".")[0])
to
major = 5
That makes "ExampleButton" widget show up when I run:
pyqt5-tools designer --example-widget-path
Before this I also got the PyQt5 example plugins to show up by copying all files from the:
<PyQt5-source>\pyqt\examples\designer\plugins\python
and
<PyQt5-source>\pyqt\examples\designer\plugins\widgets
directories to my custom PYQTDESIGNERPATH directory. I had to flatten that directory structure though by copying all files from both directories directly to the PYQTDESIGNERPATH directory.
I have very little Python experience and is just starting out with QT and PyQt so it's likely this isn't entirely correct but this made it work for me at least. From my understanding it seems like this repository is supposed to add an exception dialog showing errors in widgets that failed to load but it seems like this is not working. Instead the widgets just silently fail to load.
The README says that the designer program silently crashes without this added dialog but currently it seems like the widgets just silently fail to load instead.
It seems like this repository has not had much activity in quite a while. PyQt 5.15.5 - 5.15.7 exist but pyqt-tools only support 5.15.4 and that might not be fully working either, at least not in my setup. I tried installing many older versions of pyqt-tools though but all of them were broken in the same way.
I have installed this package on windows using a conda environment (python 3.8.8, PyQt5==5.15.4, pyqt5-tools==5.15.4.3.2) . I try to get the examplebutton to display in QtDesigner using:
pyqt5-tools designer --example-widget-path
However, nothing shows up in the designer widget list. I have checked the environment variables and PYQTDESIGNERPATH points to the folder with examplebutton.py and examplebuttonplugin.py. Am I missing something?