[Kde-perl] pqt-designer, custom widgets, and DND

Germain Garand germain at ebooksfrance.org
Tue Jan 27 22:26:02 CET 2004


Le Mardi 27 Janvier 2004 15:24, Rob Deker a écrit :
> Hi,
>
>  I'm pretty much a PerlQt newbie, and I'm trying to write a small app
> that has DND with a couple of QIconView widgets. From the looks of
> thins, I need to subclass QIconView and QIconViewItem for all of this to
> work. No problems there.

> My question is, how to I get pqt-designer to
> let me use my new subclassed widget in my GUI layout? It would appear
> that in order to add a custom widget I'll have to write up the C++ .h
> file for it and then fully describe it. Is that the case or is there
> some easier path I'm missing?

You just need to use the Tools->Custom->Edit Custom Widgets... dialog, there's 
no need to write an header file.

Simply enter whatever you want in the C++ header field, it will be ignored by 
puic (this information is only used to generate the right include statement 
in C++). You still need to describe your widget's interface (sig, slots...) 
in the dialog though.

Of course, this generates a "simple" custom widget, appearing as a static 
pixmap in the designer.

I have a mean to add interactive, plugins widgets as well but 
that would be a bit clumsy, and a memory pig :)
Still, if there are people interested, why not...




More information about the Kde-perl mailing list