Re: [PyKDE] QSqlCursor problems
On Tuesday 05 February 2002 9:02 am, Phil Thompson wrote: Jon wrote: Hello I am getting the same problem as reported by Nico van der Walt on Tue, 18 Dec 2001. QSqlCursor returns blank for text fields and zero for numeric fields. I am using the MySql driver. Does anyone know if this problem has been resolved yet ? Jon I've not tested it recently (since I downgraded my g++), but I assume the problem is still there. I got as far as finding that the problem was from a QVariant ctor being used to copy the column value - but there I got stuck. What compiler are you using? Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde In fact I had fixed the bug. I just had not rebuilt PyQt properly. So to recap: QSqlCursor calls QSqlQuery::afterSeek() instead of QSqlCursor::afterSeek() giving a cursor full of zeros. This is fixed by uncommenting void afterSeek(); in qsqlcursor.sip and doing a complete rebuild. Another small problem I found is that 'make rebuild-src' is broken in PyQt-3.0. Jon. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] Newbie questions ...
Hi folks! I am a PyQt newbie and I am sorry to bother you with my obviously very simple problem. When pushing a button I can't get it done to call the function I would like to call. I spent quite some time playing around with self.connect(...), but I always recieve an AttributeError. I hope someone can help me solving my silly problem. Underneath is some of my code and the error I get to describe the problem. Thanks a lot in advance for all help!! Oliver import sys from qt import * class MyWidget(QWidget): def __init__(self,parent=None,name=None): QWidget.__init__(self,parent,name) self.sec1x = 10; self.sec1y = 50 self.button1 = QPushButton(Open File, self.GroupBox1) self.button1.setGeometry(self.sec1x, self.sec1y, 70, 25) self.connect(self.button1, SIGNAL(clicked()), self.slotFile) def slotFile(self): #do something a = QApplication(sys.argv) w = MyWidget() w.setGeometry(50,50,420,440) a.setMainWidget(w) w.show() a.exec_loop() Traceback (most recent call last): File C:\Python21\Pythonwin\pywin\framework\scriptutils.py, line 301, in RunScript exec codeObject in __main__.__dict__ File C:\Python21\PyQt\GCX3.py, line 143, in ? w = MyWidget() File C:\Python21\PyQt\GCX3.py, line 127, in __init__ self.connect(self.button1, SIGNAL(clicked()), self.slotFile) AttributeError: slotFile ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] Newbie questions ...
Hi Oliver, the indentation of slotFile looks incorrect to me. You define that function inside the __init__ function, not in the class block. Or, if you want it defined there, do not use self with slotFile (because it is not a class member function then). - Soeren class MyWidget(QWidget): def __init__(self,parent=None,name=None): def slotFile(self): #do something ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] Newbie questions ...
Thank you Soeren! I changed the indentation for def slotFile(self): and it now it works. I should have seen that myself ... :-) Thanks again for the help! Oliver ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] Can't inherit from QLineEdit?
Phil Thompson wrote: Jonathan Gardner wrote: I can't seem to inherit from QLineEdit in python. When I call QLineEdit.__init__ in my init statement, it causes a segmentation fault. Can you send me a small, but complete, example script. I can't seem to reproduce the bug anymore. Odd... Jonathan ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] QSqlCursor problems
Jon wrote: On Tuesday 05 February 2002 9:02 am, Phil Thompson wrote: Jon wrote: Hello I am getting the same problem as reported by Nico van der Walt on Tue, 18 Dec 2001. QSqlCursor returns blank for text fields and zero for numeric fields. I am using the MySql driver. Does anyone know if this problem has been resolved yet ? Jon I've not tested it recently (since I downgraded my g++), but I assume the problem is still there. I got as far as finding that the problem was from a QVariant ctor being used to copy the column value - but there I got stuck. What compiler are you using? Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde In fact I had fixed the bug. I just had not rebuilt PyQt properly. So to recap: QSqlCursor calls QSqlQuery::afterSeek() instead of QSqlCursor::afterSeek() giving a cursor full of zeros. This is fixed by uncommenting void afterSeek(); in qsqlcursor.sip and doing a complete rebuild. Well done - many thanks. Another small problem I found is that 'make rebuild-src' is broken in PyQt-3.0. I know. It's repaired (but maybe not completely) in the CVS version. Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] Problem with pyuic and QTable
Kaercher, Joerg wrote: Hi, I noticed two problems with the pyuic from PyQt v3.0 (patches 1 through 4) when using a QTable widget: 1) 'from qttable import *' is missing and thus the QTable class is not found. 2) The calls to 'setNumCols()' and 'horizontalHeader().setLabel()' appear on the same line without a semicolon in between. Both cases generate a runtime error in Python. Now fixed in CVS. Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'PyQt/pyuic3 form.cpp object.cpp uic.cpp'
Update of /public/PyQt/pyuic3 In directory valentine.thekompany.com:/tmp/cvs-serv13983/pyuic3 Modified Files: form.cpp object.cpp uic.cpp Log Message: More work on the new build system. Fixed a bug in eric for PyQT v3. Fixed a couple of QTable related bugs in pyuic for Qt v3. Fixed a QToolBar related bug in pyuic for Qt v3. Fixed bugs with QSqlCursor. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'PyQt/debugger DebugServer.py'
Update of /public/PyQt/debugger In directory valentine.thekompany.com:/tmp/cvs-serv13983/debugger Modified Files: DebugServer.py Log Message: More work on the new build system. Fixed a bug in eric for PyQT v3. Fixed a couple of QTable related bugs in pyuic for Qt v3. Fixed a QToolBar related bug in pyuic for Qt v3. Fixed bugs with QSqlCursor. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'PyQt ChangeLog Makefile build.sh qsqlcursor.sip'
Update of /public/PyQt In directory valentine.thekompany.com:/tmp/cvs-serv13983 Modified Files: ChangeLog Makefile build.sh qsqlcursor.sip Log Message: More work on the new build system. Fixed a bug in eric for PyQT v3. Fixed a couple of QTable related bugs in pyuic for Qt v3. Fixed a QToolBar related bug in pyuic for Qt v3. Fixed bugs with QSqlCursor. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] ANN: SIP/PyQt v3.1pre1
The first pre-release of SIP and PyQt v3.1 is at http://www.riverbankcomputing.co.uk/download/snapshots/. All known bugs have been fixed. The remaining work for 3.1 is the completion of the new build system, including building for Windows. Other than bug fixes, the main change is support for Qt/Embedded and the Qt Palmtop Environment (aka Qtopia), although the new qtpe module only contains the QPEApplication class at the moment. Also, the SIP runtime library is now a Python module. You might want to manually remove your old version from /usr/local or wherever. At the moment the module doesn't include anything you can call directly from Python - but I'm open to requests (eg. a function to explicitly call the C++ dtor of a wrapped instance). Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] [cvs commit] 'sip ChangeLog NEWS configure.ac'
Update of /public/sip In directory valentine.thekompany.com:/tmp/cvs-serv28973 Modified Files: ChangeLog NEWS configure.ac Log Message: The AutoGen option now takes an optional feature name (needed for PyKDE2). ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] Re: PyKDE2 alpha 3 Available
On 08-Feb-02 Henrik Motakef [EMAIL PROTECTED] wrote: Henrik Motakef [EMAIL PROTECTED] writes: - More serious is a make error in the dcop directory, because of ld not finding the dcopc library (-ldcopc is in libdcopxmodule_ls_LIBADD, an in various other places in different directories). Indeed, there isn't any libdcopc anywhere on my system. Where should it be/ come from? For fun, I tried to just remove -ldcopc from the Makefiles (in dcop,kdebase, kdeui, kio and kfile), and... it worked! It seems to pass almost all implemented tests, including the DCOP ones. I looked at this and it didn't look like fun :), but THANKS! - that's above and beyond the call of duty and it's nice to know it compiles with both FreeBSD and KDE2.2.2. The next alpha version (alpha4) will fix this. I already put you in the THANKS file for the first post - don't know what more I can say but thanks again. The only non-trivial failure (like those due to the fact that I haven't KWrite on my Desktop or in /opt/kde2/bin) was an exception in the KAccel test: I'll look at fixing the KWrite part too. Traceback (most recent call last): File testkdecore.py, line 163, in testKAccel self.ked.insertLine ( aCurrentKeyCode = + str (tuple [0])) File /usr/local/lib/python2.1/site-packages/kdecore.py, line 508, in __getattr__ return libkdecorec.sipCallGetVar(81,self,name) AttributeError: __getitem__ Traceback (most recent call last): File testkdecore.py, line 163, in testKAccel self.ked.insertLine ( aCurrentKeyCode = + str (tuple [0])) File /usr/local/lib/python2.1/site-packages/kdecore.py, line 508, in __getattr__ return libkdecorec.sipCallGetVar(81,self,name) AttributeError: __getitem__ I haven't looked at this lately - I believe the problem is due to changing some stuff from a sip MappedType to a Python class (almost all C++ structs should now be implemented as Python classes in PyKDE2). The 'test' stuff just covers some of the handwritten code at the moment and since the handwritten stuff is all pretty similar it's a good indication to me that I'm talking to the siplibs intelligbly. I have some apps I use that depend on the basic interface stuff (kdecore, kdeui, kfile and a little of kio), so I test far enough to know that the basic functionality is there. If anyone is interested in contributing code to test things, it would be a big help - there's a lot here. The same goes for demo apps or templates to make it easier for people to start using PyKDE2. I'll get to some of this eventually, but probably not all of it and probably not soon. The bug above probably won't get fixed for a while but I'll at least verify the cause in the near future. I'm pretty confident about the kdecore/kdeui/kfile stuff working. I'm not as confident about things like DCOP, KParts and haven't gotten to khtml yet (I will eventually as I need it for something I want to write). It would help too if someone familiar with the latter topics could review what's there, test it, or even write a simple demo - I'm not even sure I understand how KDE uses some of this stuff at the moment, and some parts are still not implemented. Contributions in any of these areas get your name in the 'Authors' file. You can email me anything up to about 1MB. However, it rocks. Thanks! I'll agree with that, since I didn't really create this. The people who do Python, Qt, KDE and Phil (who does sip and PyQt) have created a really great environment to work in. Jim PS: For some reason my replies seem to take an extra day to post to the 'digest', which is how I read this list. I don't know if they're taking longer to get out as individual messages, but I'm trying to remember to reply directly to posters as well. Apologies to posters if you're getting duplicate replies. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Fwd: Re: [PyKDE] Mapping C++ exceptions to Python exceptions
-- Forwarded Message -- Subject: Re: [PyKDE] Mapping C++ exceptions to Python exceptions Date: Fri, 8 Feb 2002 05:28:24 -0500 (EST) From: Donovan Rebbechi [EMAIL PROTECTED] To: Jon [EMAIL PROTECTED] Could you CC this to the list ? It rejects my posts, and the admins of the list server do not seem interested in fixing the problem. There currently isn't a way to do this. You need to use %MemberCode, use a try/catch block, and then use PyErr_SetString() or something to set up a python exception. This would be a *very* useful feature. At present, anything that can throw needs %MemberCode, because if an exception escapes a C++ call, the interpreter aborts. At the very least, it might be worth having an option for each function that puts the body code in a try { } block to suppress exceptions. -- Donovan --- ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] KStdAction with Python slots/ Writing KParts
[EMAIL PROTECTED] writes: Hi. Two questions about PyKDE2: (How) Can I connect KStdActions to a Python method? It looks as if I only can use form KStdAction.foo(self, SLOT(bar()), self.actionCollection()), which respects overridden methods, but doesn't work with methods not contained in KMainWindow. Is it possible to write, say, a Konqueror Plugin in Python? It looks like all neccessary classes are implemented, however I obviously cannot build a libmypart.so. (Probably related - is it possible to implement KIOSlaves?) Regards Henrik ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde