[PyKDE] khtml/kparts segfault on keyPressEvent

Troy Melhase troy at gci.net
Mon Dec 8 23:02:01 GMT 2003


Hi Folks:

The test script below works for me as expected.  If khtml or kparts is 
imported as part of the script, python segfaults when a key is pressed in the 
window.

I'm running:
	python 2.3.2
	sip 3.8 (build 109)
	qt 3.1.2 (196866)
	pyqt 3.8.1 (198657)
	pykde 3.8.0
	kde 3.1.4

When building PyKDE, I edited sip/kaccelmanager.sip and commented out each of 
the 'manage' definitions -- I got segfaults importing pykde modules 
otherwise.

My obvious question is:  could the undefined kaccelmanager functions be part 
of this problem, and if so, what's the proper definition to include in 
kaccelmanager.sip to have it compile correctly for my env?

My other obvious questions are:  Have I done something wrong?  What do I do 
from here?   Any help is greatly appreciated.

The backtrace follows the script, but I've compiled without symbols, so it's 
of little help I think.

Script:
import sys
#import khtml
#import kparts
from qt import *

class Test(QTextEdit):
    def keyPressEvent(self, e):
        text, key, ascii, state = e.text(), e.key(), e.ascii(), e.state()
        print text, key, ascii, state
        e.ignore()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    shell = Test(None)
    app.setMainWidget(shell)
    shell.show()
    app.exec_loop()

Backtrace:
#0  0x00000000 in ?? ()
No symbol table info available.
#1  0x42c872d5 in sipSubClass_khtml_MouseEvent(QEvent const*) ()
   from /usr/lib/python2.3/site-packages/libkhtmlcmodule.so
No symbol table info available.
#2  0x404f13bc in convertSubClass ()
   from /usr/lib/python2.3/site-packages/libsip.so
No symbol table info available.
#3  0x404f1009 in sipMapCppToSelfSubClass ()
   from /usr/lib/python2.3/site-packages/libsip.so
No symbol table info available.
#4  0x414827fb in sipQWidget::sipVH_keyPressEvent(sipMethodCache const*, 
_sipThi
sType*, QKeyEvent*) () from /usr/lib/python2.3/site-packages/libqtcmodule.so
No symbol table info available.
#5  0x41279574 in sipQTextEdit::keyPressEvent(QKeyEvent*) ()
   from /usr/lib/python2.3/site-packages/libqtcmodule.so
No symbol table info available.
#6  0x4077e57c in QWidget::event(QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#7  0x408837dd in QTextEdit::event(QEvent*) () from 
/usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#8  0x41278133 in sipQTextEdit::event(QEvent*) ()
   from /usr/lib/python2.3/site-packages/libqtcmodule.so
No symbol table info available.
#9  0x406ec4c4 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#10 0x406ebe3c in QApplication::notify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#11 0x4149d6db in sipQApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/python2.3/site-packages/libqtcmodule.so
No symbol table info available.
#12 0x4069399e in QETWidget::translateKeyEvent(_XEvent const*, bool) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#13 0x4068f68d in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#14 0x406a4bc1 in QEventLoop::processEvents(unsigned) ()
   from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#15 0x407002c6 in QEventLoop::enterLoop() () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#16 0x40700168 in QEventLoop::exec() () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#17 0x406ec6f1 in QApplication::exec() () from /usr/qt/3/lib/libqt-mt.so.3
No symbol table info available.
#18 0x4149fa9b in sipDo_QApplication_exec_loop(_object*, _object*) ()
   from /usr/lib/python2.3/site-packages/libqtcmodule.so
No symbol table info available.



-- 
Troy Melhase, troy at gci.net
--
Any sufficiently advanced technology is indistinguishable from Python.





More information about the PyQt mailing list