[PyKDE] PyQt and lambda expressions doesn't like each other
Phil Thompson
phil at river-bank.demon.co.uk
Mon Apr 28 14:54:00 BST 2003
On Monday 28 April 2003 1:31 pm, Hans-Peter Jansen wrote:
> This doesn't work (while it should):
>
> import sys
> from qt import *
>
> app = QApplication(sys.argv)
> button = QPushButton("&Hello World", None)
> app.setMainWidget(button)
> button.show()
> app.connect(button, SIGNAL("clicked()"), lambda: app.exit(0))
> app.exec_loop()
>
> Any ideas, why?
connect() doesn't take a reference to a slot so it gets garbage collected
immediately.
Phil
More information about the PyQt
mailing list