[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Connections with QWidgetFactory
From:       "Phil Thompson" <phil () riverbankcomputing ! co ! uk>
Date:       2005-03-23 9:15:30
Message-ID: 28987.82.68.80.137.1111569330.squirrel () river-bank ! demon ! co ! uk
[Download RAW message or body]

> Hello
>
> I have a designer file that defines my app main window ("principal.ui").
>
> Then using QWidgetFactory the actual window is created:
>
> ----------------------
> def main(args):
>     app=QApplication(args)
>     pyimpl = R() # R is derived from QObject
>     mainWindow = QWidgetFactory.create("principal.ui", pyimpl)
>     pyimpl.setParent(mainWindow)
>     mainWindow.show()
>     app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
>     app.exec_loop()
> ----------------------
>
> In C++, if you pass a second parameter to QWidgetFactory.create,  qt
> automatically creates the conections defined in the ui file, using the
> slots of the 2nd parameter.
>
> But in PyQt, no connection is made. żIs this correct?

If R is a wrapped C++ implementation of a QObject sub-class then it should
work.

If R is a Python implementation of a QObject sub-class then it won't work
because QWidgetFactory.create() doesn't know anything about Python
objects.

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic