[PyQt] derive from a designer widget

Mario Daniel Carugno carugnom at gmail.com
Wed Mar 11 21:29:17 GMT 2009


2009/3/11 Andreas Pakulat <apaku at gmx.de>:
> On 11.03.09 16:55:11, Mario Daniel Carugno wrote:
>> Hi, i'm using pytq4 + designer4.
>> I want to design a generic main window with common buttons (next,
>> previous, new, edit, ...)
>> with a central area for data. That central area could be a frame.
>> In QT3 remember i could derive my widget from another one made with
>> designer, but that is
>> not possible in QT4. That the behaviour i want.
>
> You can still do the same thing, except that you'll additionally need a
> python class subclassing QMainWindow that loads the ui from the designer
> form. Then you can create subclasses from that and set the central
> widget. If the form is a member of your base class you can also access
> it and all widgets from the subclass.
>
Thank you Andreas, i'll try it. Just in case, do you have some example
of that ?

Regards


More information about the PyQt mailing list