[Eric] Migrating from eric 3 / QT 3 to eric 4 / QT 4
Detlev Offenbach
detlev at die-offenbachs.de
Fri Apr 10 18:45:24 BST 2009
On Donnerstag, 9. April 2009, Stephen Schaub wrote:
> I teach PyQt GUI development with Eric in a University-level Unix
> Programming class, and have a question about migrating to eric4 / QT 4.
>
> With eric3 / QT 3, I used the following approach to develop applications:
> 1. Use Qt Designer to do the GUI layout for a window and define custom
> slots.
> 2. Use eric to compile the form and generate a subclass
> 3. Override the custom slots in the subclass and put event handling code in
> them
>
> With eric4, I am able to compile a .ui file to a PyQt class. But I don't
> see any wizard to generate a subclass, as in eric 3. If there isn't one, we
> can manage; I just thought I would ask, in case I was missing it.
In the forms viewer just select the form, open the context menu and
select "Generate dialog code". In there, you are given the choice to select
the signals you want to connect to. The dialog generates code with slots of
the form "on_<widgetename>_<signalname>(<signature>)". This code is preceded
by the right @pyqtSignature" decorator call. The .ui file generated by pyuic4
uses the automatic connection feature.
>
> Also, the PyQt docs indicate that there are several ways of subclassing
> pyuic4-generated classes:
>
> http://www.riverbankcomputing.com/static/Docs/PyQt4/pyqt4ref.html#using-the
>-generated-code
>
> I would prefer to use the PyQt 3 approach. But I can't figure out how to
> wire up the signals in the Designer to custom slots in my Python code (as I
> could with designer 3 / eric 3). Any tips would be greatly appreciated.
Btw, would you like to write a testimonial?
Regards,
Detlev
--
Detlev Offenbach
detlev at die-offenbachs.de
More information about the Eric
mailing list