[PyKDE] C++ Anomalie

Jim Bublitz jbublitz at nwinternet.com
Thu Oct 5 21:37:11 BST 2006


On Thursday 05 October 2006 11:33, Joshua J. Kugler wrote:
> [Please pardon the top post]

> Jim, how are you connecting to KSpread?  Are you using DCOP?  Something
> else? I really don't know anything about C++ scripting of KSpread, but I do
> know there are DCOP interfaces that might simplify things.  But maybe not.

I'm starting up KSpread via Python rather than KoApplication/KoMainWindow, so 
what I'm really running is PyKSpread. Basically, I'm importing the KSpread 
part (read/write). I'm also writing a C++ wrapper to get direct access to the 
KSpread internals, and then using sip to create Python bindings for the 
wrapper. Might sound complicated, but it's incredibly simple.

The ctor call is failing within libkspreadcommon.so, being called from the 
wrapper via a call from Python. If I was screwing up KSpread, I'd look first 
at some programming error on my part, but in a language with strict type 
checking (C++) on a processor that segments code and data and will generate a 
hardware exception if you write to the code segment, I can't see any way that 
I can program something that will cause lib code to confuse a QRect with a 
QString.

This isn't a KSpread code bug or error - it's some problem with gcc or ld I'd 
guess - the code is correct, and in fact the same program path prints correct 
output from my printfs (from calls initiating within libkspreadcommon) about 
20 times before my call leads to the crash. And in fact just before the 
failing call, the program "knows" that 'range' is a QRect and can even 
display range's members.

Jim




More information about the PyQt mailing list