Python Forum

Full Version: How to Integrate PyQt4 Custom Widget with Qt Designer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

I am quite new to PyQt and am having some difficulty integrating custom PyQt4 widgets into Qt Designer.

I'm using the analogclock.pyw custom widget example that ships with the PyQt4 installation (found in the PyQt4/examples/designer/plugins/widgets folder), and analogclockplugin.py plugin file example (found in the PyQt4/examples/designer/plugins/python folder).

From the following articles:
https://wiki.python.org/moin/PyQt/Using_...t_Designer
http://pyqt.sourceforge.net/Docs/PyQt4/designer.html
https://doc.qt.io/archives/qq/qq26-pyqtd...ngsinplace


I am under the impression that I must put the plugin file either in the PyQt4\plugins\designer\python default directory, or in a directory as specified in PYQTDESIGNERPATH path variable, so I put the default directory into this path variable as well. I then placed both the widget and plugin python code into this directory and start up designer.exe, but I cannot see the analog clock widget in the widget box. I also see no attempt (via Help -> About Plugins) of loading the plugin at all.
There is another bit of information that might be useful. In the Plugin Information dialog box within Qt Designer, it says that one of the failed plugins are pyqt4.dll with the following error message: "Cannot load library C:/.../PyQt4/plugins/designer/pyqt4.dll: The specified module could not be found.

I am wondering if this plugin may be required to load successfully for custom widgets written in python to be integrated in the first place?