Re: [PyKDE] Lambda function call in connect statement
Phil Thompson wrote: Sorry - I should have noticed this right at the start... The problem is that you are not keeping a reference to the function object that lambda returns - so it is getting garbage collected immediately. The signal is them emitted to an object that no longer exists, hence the segfault. Change the code to be something like... self.lam = lambda s=self,x=num:s.changeTopStruct(x) self.connect( self.top_struct_button, SIGNAL( "clicked()" ), self.lam ) QObject.connect does not keep a reference to the slot object to avoid (potential) hidden circurlar references - but it does mean that you have to manage them yourself. The weakreferences module in Python 2.1 looks interesting - it might offer a more programmer friendly solution. Phil Great! This works. I had a feeling the problem was that I was using lambda incorrectly. -- Aaron J. GinnPhone: 480-814-4463 Motorola SemiCustom SolutionsPager: 877-586-2318 1300 N. Alma School Rd. Fax : 480-814-4463 Chandler, AZ 85226 M/D CH260 mailto:[EMAIL PROTECTED] ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'sip/sip gencode.c parser.y sip.h'
Update of /public/sip/sip In directory valentine.thekompany.com:/tmp/cvs-serv7512/sip Modified Files: gencode.c parser.y sip.h Log Message: Added support for the in-place operators introduced in Python v2.0. Python slots are now wrapped in weak references which means that when the programmer forgets to keep a slot alive it won't core dump. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] Qwt-0.3, Numerical Python, Black Adder, etc
Hi Phil, Mark I have a set of alpha Python bindings to the Qwt-0.3 library. Qwt stands for "Qt Widgets for Technical applications" and version 0.3 works with Qt-2.x. For more info: http://qwt.sourceforge.net/ Some of the code is stolen from Mark Colclough's bindings to Qwt-0.2 (which works with Qt-1.x) See http://www.cm.ph.bham.ac.uk/software/pyqt One of my improvements is that it interfaces to the Numerical Python library, see http://numpy.sourceforge.net/ This library allows you to manipulate arrays of numbers as if it were numbers (in MatLab style). Example, the three lines: x = arrayrange(0.0, 100.0, 0.1) y = sin(x) z = cos(y)*exp(-x*x) creates an x array of 1000 numbers: 0.1, 0.2, 0.3,... and corresponding y and z arrays The interface to Qwt solves one of the great weaknesses of Python on Linux: data plotting. Question 1: To make this work, I have to add after the line: Py_InitModule("libqwtc",methods); import_array(); in the initlibqwtc() function in qwtcmodule.cpp Is there a way to tell sip to do that automatically? (a kind of before-InitModule hook and after-InitModule hook) Question 2: I have installed Python-2.0 on my Mandrake-7.2 system and also boughth a personal edition of Black Adder. At least superficially, it looks like if there are name conflicts in /usr/lib/python2.0/site-packages Black Adder has:libbaqtcmodule.so*, qt.py PyQt has: libbqtcmodule.so*, and qt.py Can I remove PyQt, rebuild my PyQwt using the .sip files of PyQt and expect that it will work with Black Adder? Or, if there is any NON-FREE code in libbaqtcmodule, could you split it up between a free PyQt part and a NON-FREE Black Adder part? Gerard PS: I will put the bindings on the WEB shortly. If anybody is interested, ask me and I will send the code. -- Gerard Vermeulen | TEL: 33 (0)4 76 88 12 53 CRTBT | or 33 (0)4 76 88 12 61 BP 166 -- 38042 Grenoble Cedex 9 -- France | Fax: 33 (0)4 76 87 50 60 http://www-crtbt.polycnrs-gre.fr/he3pol ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'PyQt qinterlacestyle.sip ChangeLog Makefile NEWS qapplication.sip qfontdatabase.sip qscrollview.sip qt.sip-in qtoolbar.sip'
Update of /public/PyQt In directory valentine.thekompany.com:/tmp/cvs-serv9645 Modified Files: ChangeLog Makefile NEWS qapplication.sip qfontdatabase.sip qscrollview.sip qt.sip-in qtoolbar.sip Added Files: qinterlacestyle.sip Log Message: Added the new methods and classes implemented in Qt v2.3.0-beta1. Updated pyuic from Qt v2.3.0-beta1. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'sip ChangeLog'
Update of /public/sip In directory valentine.thekompany.com:/tmp/cvs-serv9659 Modified Files: ChangeLog Log Message: Added support for Python v2.1 rich comparison operators. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'sip/sip gencode.c parser.y sip.h'
Update of /public/sip/sip In directory valentine.thekompany.com:/tmp/cvs-serv9659/sip Modified Files: gencode.c parser.y sip.h Log Message: Added support for Python v2.1 rich comparison operators. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'PyQt/pyuic uic.cpp'
Update of /public/PyQt/pyuic In directory valentine.thekompany.com:/tmp/cvs-serv9645/pyuic Modified Files: uic.cpp Log Message: Added the new methods and classes implemented in Qt v2.3.0-beta1. Updated pyuic from Qt v2.3.0-beta1. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde