[PyQt] [SOLVED] help with designer plugin for custom widget.

Josh jknox at irobot.com
Fri Apr 9 15:27:44 BST 2010


Josh wrote:
> Josh wrote:
>> Josh wrote:
>>> I've got a Qt widget and a PyQt binding. I want to make a Designer 
>>> plugin for it.
>>>
>>> I have a Designer plugin as a C++ class. It works fine, I can add it 
>>> to layouts, etc.
>>>
>>> Am I correct in assuming that my PyQt binding will not work to load 
>>> the C++ class when added via the C++ designer plugin?
>>>
>>> I have been trying to make a PyQt designer plugin by subclassing 
>>> QPyDesignerCustomWidgetPlugin but I cant get designer to load it.
>>>
>>> I tried placing the pyqt plugin in directories specified in both 
>>> QT_PLUGIN_PATH & PYQTDESIGNERPATH but it never shows up.
>>>
>>> I suspect I'm not putting it in the right place, but I'm not sure. 
>>> designer doesn't indicate any errors.
>>>
>>> Anyone have any suggestions on what to check?
>>>
>>> Thanks!
>>>
>>> Josh
>>> _______________________________________________
>>> PyQt mailing list PyQt at riverbankcomputing.com
>>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>> Some more info...
>>
>> In Designer->help->about plugins i see that libpythonplugin.so is 
>> listed, along with the example plugins, and my c++ plugin. My python 
>> plugin is not listed.
>>
>>
>> I tried copying all of the PyQt plugin examples into designer's 
>> plugin dir. They all show up in designer. So PyQt plugins are 
>> working, except for mine.
>>
>> My python plugin is in the same directory as the rest but it never 
>> even gets byte-compiled, so obviously nothing is loading it. 
>> Everything else has a .pyc after it gets loaded. FWIW, the 
>> permissions are also the same as the other plugins.
>>
>> I compared my plugin code to the examples and the code looks fine.
>>
>> I'm totally stumped! ;)
>>
>> Thanks for any help,
>>
>> Josh
>>
>> _______________________________________________
>> PyQt mailing list PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> a little more info...
> I'm running on Ubuntu 9.04, using the following packages I've built 
> myself:
> PyQt 4.7
> Qt v4.6.1
> SIP 4.10
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Doh!

Solved the problem after re-reading the docs for Writing Qt Designer 
Plugins.

pyqt plugin base names are required to end with "plugin". Mine ended 
with "Plugin". After changing the case on "P", designer loads my plugin.

Josh




More information about the PyQt mailing list