[PyQt] Custom Widget for Designer

Emiliano Mennucci ekumene at gmail.com
Thu Nov 6 14:33:24 GMT 2008


Hi,
I have a custom widget named "WidgetFoo" (and written in PyQt4, of course)
which I successfully exported to Designer (using a class "WidgetFooPlugin"
inherited from "QPyDesignerCustomWidgetPlugin").
When I load Designer, I can see "WidgetFoo" loaded and I can put it on a
form. So everything works well.

Now I want to change the name of the widget when it's exported on Designer.
So class name should remain "WidgetFoo" but I want it to be showed as "A
custom Widget" in the Designer palette. I'm not able to achieve this simple
goal. I figured that I have to change the string returned by the method
WidgetFooPlugin.name, but if I try I get a message while loading designer:
"Designer: A class name mismatch occurred when creating a widget using the
custom widget factory registered for widgets of class A custom Widget. It
returned a widget of class WidgetFoo".
I've checked all examples contained in pyqt sources but it seems that no one
tryes to accomplish this.

Is there a way to tell Qt Designer to show widget on the palette with a
different string (not the class name)?

Emiliano

-- 
life's better without braces - Bruce Eckel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20081106/b5275446/attachment.html


More information about the PyQt mailing list