[PyKDE] Segmentation fault with dynamic creating of widget content
Wido Depping
wido.depping at tu-clausthal.de
Tue Jun 17 00:36:01 BST 2003
I have a widget whose children are created dynamicly. if i get new data i have
to refresh the widget, delete all it's children and create the child-widgets
again. Most of the time this method works, but sometimes i get a segmentation
fault.
This is the method for the deletion of the children:
for x in self.attributeWidget.children():
name = str(x.name())
# this ensures, that the layout is not deleted
# every label, lineedit and button has a name which starts with 'LDAP'
if name[:4] == "LDAP":
x.destroy()
self.attributeWidget.removeChild(x)
So, is my code wrong or is it PyQt's fault? Attached is a backtracke i got
from gdb:
#0 0x4029a65f in QWidget::focusProxy() const () from
/usr/qt/3/lib/libqt-mt.so.3
#1 0x403660e8 in QScrollView::focusNextPrevChild(bool) () from
/usr/qt/3/lib/libqt-mt.so.3
#2 0x41248ff0 in sipQScrollView::focusNextPrevChild(bool) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#3 0x4029a9be in QWidget::focusNextPrevChild(bool) () from
/usr/qt/3/lib/libqt-mt.so.3
#4 0x4029a9be in QWidget::focusNextPrevChild(bool) () from
/usr/qt/3/lib/libqt-mt.so.3
#5 0x413420f6 in sipQWidget::focusNextPrevChild(bool) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#6 0x4029a9be in QWidget::focusNextPrevChild(bool) () from
/usr/qt/3/lib/libqt-mt.so.3
#7 0x411cc2e0 in sipQLineEdit::focusNextPrevChild(bool) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#8 0x4029bcee in QWidget::hide() () from /usr/qt/3/lib/libqt-mt.so.3
#9 0x413516ba in sipDo_QWidget_hide(_object*, _object*) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#10 0x080dcaac in PyCFunction_Call ()
#11 0x080788b3 in Py_MakePendingCalls ()
#12 0x08079269 in PyEval_EvalCodeEx ()
#13 0x0807a1fa in PyEval_CallObjectWithKeywords ()
#14 0x080787f5 in Py_MakePendingCalls ()
#15 0x08079269 in PyEval_EvalCodeEx ()
#16 0x0807a1fa in PyEval_CallObjectWithKeywords ()
#17 0x080787f5 in Py_MakePendingCalls ()
#18 0x08079269 in PyEval_EvalCodeEx ()
#19 0x080cfcf9 in PyStaticMethod_New ()
#20 0x080bc649 in PyObject_Call ()
#21 0x080c3c98 in PyMethod_Fini ()
#22 0x080bc649 in PyObject_Call ()
#23 0x08079fd5 in PyEval_CallObjectWithKeywords ()
#24 0x40005947 in sipEmitToSlot(sipSlot*, _object*) () from
/usr/lib/python2.2/site-packages/libsip.so
#25 0x40fed465 in sipProxyqt::proxySlot() () from
/usr/lib/python2.2/site-packages/libqtcmodule.so
#26 0x41389464 in sipProxyqt::qt_invoke(int, QUObject*) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#27 0x40268639 in QObject::activate_signal(QConnectionList*, QUObject*) ()
from /usr/qt/3/lib/libqt-mt.so.3
#28 0x402684dd in QObject::activate_signal(int) () from
/usr/qt/3/lib/libqt-mt.so.3
#29 0x4054fcfe in QButton::clicked() () from /usr/qt/3/lib/libqt-mt.so.3
#30 0x402ea786 in QButton::mouseReleaseEvent(QMouseEvent*) () from
/usr/qt/3/lib/libqt-mt.so.3
#31 0x410f7830 in sipQPushButton::mouseReleaseEvent(QMouseEvent*) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#32 0x4029c90c in QWidget::event(QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
#33 0x410f6223 in sipQPushButton::event(QEvent*) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#34 0x4020a644 in QApplication::internalNotify(QObject*, QEvent*) () from
/usr/qt/3/lib/libqt-mt.so.3
#35 0x40209c23 in QApplication::notify(QObject*, QEvent*) () from
/usr/qt/3/lib/libqt-mt.so.3
#36 0x41360f9b in sipQApplication::notify(QObject*, QEvent*) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#37 0x401afdfb in QETWidget::translateMouseEvent(_XEvent const*) () from
/usr/qt/3/lib/libqt-mt.so.3
#38 0x401ad693 in QApplication::x11ProcessEvent(_XEvent*) () from
/usr/qt/3/lib/libqt-mt.so.3
#39 0x401c2cc1 in QEventLoop::processEvents(unsigned) () from
/usr/qt/3/lib/libqt-mt.so.3
#40 0x4021e466 in QEventLoop::enterLoop() () from /usr/qt/3/lib/libqt-mt.so.3
#41 0x4021e308 in QEventLoop::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#42 0x4020a871 in QApplication::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#43 0x4136335b in sipDo_QApplication_exec_loop(_object*, _object*) ()
from /usr/lib/python2.2/site-packages/libqtcmodule.so
#44 0x080dcaac in PyCFunction_Call ()
#45 0x080788b3 in Py_MakePendingCalls ()
#46 0x08079269 in PyEval_EvalCodeEx ()
#47 0x0807a1fa in PyEval_CallObjectWithKeywords ()
#48 0x080787f5 in Py_MakePendingCalls ()
#49 0x08079269 in PyEval_EvalCodeEx ()
#50 0x0807b777 in PyEval_EvalCode ()
#51 0x080a047b in PyRun_FileExFlags ()
#52 0x0809fc8d in PyRun_SimpleFileExFlags ()
#53 0x08053356 in Py_Main ()
#54 0x08052ecb in main ()
#55 0x4283fdc4 in __libc_start_main () from /lib/libc.so.6
More information about the PyQt
mailing list