[PyKDE] using PyQt4 custom widgets in Designer?

Andreas Pakulat apaku at gmx.de
Wed May 3 11:36:36 BST 2006


On 03.05.06 11:05:26, bastian salmela wrote:
> 
> Is there already a way to somehow (easily) use your python custom widgets in 
> new Designer? I don't really need any fancy interactivity in Designer for them, 
> mainly just a "placeholder" when I am building the GUI. 
> all help appreciated.. thanks. 

Well, if you only need a placeholder use a QFrame, right-click on it and
choose Promote to custom widget. Then provide the classname and
path/filename for the custom widget's .py-file. Be aware that you need
to leave the .h there I think.

Lets say you have a custom widget calles CusWiget and it's located in
wigdets/custom.py, you then put widgets/custom.h into the filename-field
and CusWidget into the classname.

pyuic4 will generate something like the following out of this:

from widgets import custom

...
cuswid = custom.CusWidget(parent)
...

Andreas

-- 
You will probably marry after a very brief courtship.




More information about the PyQt mailing list