[PyKDE] Segfault with QWidget::show() and MDI

Andreas Pakulat apaku at gmx.de
Sun Dec 25 20:54:11 GMT 2005


Hi,

just ported the MDI example and creating a QWidget on the QWorkspace
segfaults. Backtrace appended. The QWidget is created by clicking the
"new File" Button which executes the following python code:

	child = mdichild.MdiChild()
        self.workspace.addWindow(child)
        self.connect(child, QtCore.SIGNAL("copyAvailable(bool)"),
                     self.cutAct.setEnabled)
        self.connect(child, QtCore.SIGNAL("copyAvailable(bool)"), 
                     self.copyAct.setEnabled)
        child.newFile()
        child.show()

self is the Mainwindow class and MdiChild is derived from QTextEdit
implementing slots like save and open and handling the modification
status, nothing more.
	
Andreas

#0  0xb7410741 in convertFrom_QList_0201QTreeWidgetItem (sipCppV=0x83b9b70)
    at qlist.sip:127
#1  0xb7a2d5ef in UniversalSlot::unislot (this=0x82eb560, qargs=0xbf9f3e50)
    at qobject.sip:680
#2  0xb7a2d7c3 in UniversalSlot::qt_metacall (this=0x82eb560,
    _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbf9f3e4c) at qobject.sip:562
#3  0xb791ff2e in QMetaObject::activate (sender=0x82e85f8, from_signal_index=23,
    to_signal_index=23, argv=0xbf9f3e4c) at kernel/qobject.cpp:2671
#4  0xb7920d6d in QMetaObject::activate (sender=0x82e85f8, m=0xb6fef960,
    local_signal_index=0, argv=0xbf9f3e4c) at kernel/qobject.cpp:2709
#5  0xb6df4881 in QWorkspace::windowActivated (this=0x82e85f8, _t1=0x83b9b70)
    at moc_qworkspace.cpp:146
#6  0xb6dfff97 in QWorkspacePrivate::activateWindow (this=0x82e88e8, w=0x83b9b70,
    change_focus=true) at widgets/qworkspace.cpp:1221
#7  0xb6e025bb in QWorkspacePrivate::normalizeWindow (this=0x82e88e8, w=0x83b9b70)
    at widgets/qworkspace.cpp:1550
#8  0xb6e02d7b in QWorkspacePrivate::showWindow (this=0x82e88e8, w=0x83b9b70)
    at widgets/qworkspace.cpp:1613
#9  0xb6e0314e in QWorkspaceChild::eventFilter (this=0x83d1190, o=0x83b9b70,
    e=0xbf9f4508) at widgets/qworkspace.cpp:2617
#10 0xb6aaabb8 in QApplicationPrivate::notify_helper (this=0x81f7358,
    receiver=0x83b9b70, e=0xbf9f4508) at kernel/qapplication.cpp:3112
#11 0xb6aac86e in QApplication::notify (this=0x81f9628, receiver=0x83b9b70,
    e=0xbf9f4508) at kernel/qapplication.cpp:3077
#12 0xb74af796 in sipQApplication::notify (this=0x81f9628, a0=0x83b9b70,
    a1=0xbf9f4508) at sipQtGuiQApplication.cpp:176
#13 0xb6aa7e99 in QCoreApplication::sendEvent (receiver=0x83b9b70, event=0xbf9f4508)
    at qcoreapplication.h:171
#14 0xb6b0135d in QWidget::setVisible (this=0x83b9b70, visible=true)
    at kernel/qwidget.cpp:4490
#15 0xb725b7c6 in sipQTextEdit::setVisible (this=0x83b9b70, a0=true)
    at sipQtGuiQTextEdit.cpp:636
#16 0xb7514064 in QWidget::show (this=0x83b9b70) at qwidget.h:399
#17 0xb750c0ca in meth_QWidget_show (sipSelf=0xb7b85be4, sipArgs=0xb7e0e034)
    at sipQtGuiQWidget.cpp:4005
#18 0x08118677 in PyCFunction_Call (func=0xb7b4c504, arg=0xb7e0e034, kw=0x0)
    at Objects/methodobject.c:73
#19 0x080cb5ad in call_function (pp_stack=0xbf9f4718, oparg=0) at Python/ceval.c:3445
#20 0x080c742e in eval_frame (f=0x81972dc) at Python/ceval.c:2122
#21 0x080c97bd in PyEval_EvalCodeEx (co=0xb7dedb28, globals=0xb7e2ddf4, locals=0x0,
    args=0xb7b4c438, argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0,
    closure=0x0) at Python/ceval.c:2669
#22 0x08117e5a in function_call (func=0xb7bb6854, arg=0xb7b4c424, kw=0x0)
    at Objects/funcobject.c:504
#23 0x0805cba1 in PyObject_Call (func=0xb7bb6854, arg=0xb7b4c424, kw=0x0)
    at Objects/abstract.c:1755
#24 0x080655cf in instancemethod_call (func=0xb7bb6854, arg=0xb7b4c424, kw=0x0)
    at Objects/classobject.c:2433
#25 0x0805cba1 in PyObject_Call (func=0xb7e2bcb4, arg=0xb7e0e034, kw=0x0)
    at Objects/abstract.c:1755
#26 0x080cb1fc in PyEval_CallObjectWithKeywords (func=0xb7e2bcb4, arg=0xb7e0e034,
    kw=0x0) at Python/ceval.c:3352
#27 0xb7fde580 in initsip ()
   from /home/andreas/pyqt/lib/python2.3/site-packages/sip.so
#28 0xb7a2d6cc in UniversalSlot::unislot (this=0x82ebc00, qargs=0xbf9f517c)
    at qobject.sip:700
#29 0xb7a2d7c3 in UniversalSlot::qt_metacall (this=0x82ebc00,
    _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbf9f517c) at qobject.sip:562
#30 0xb791ff2e in QMetaObject::activate (sender=0x82ebf68, from_signal_index=5,
    to_signal_index=6, argv=0xbf9f517c) at kernel/qobject.cpp:2671
#31 0xb792011b in QMetaObject::activate (sender=0x82ebf68, m=0xb6fef6b0,
    from_local_signal_index=1, to_local_signal_index=2, argv=0xbf9f517c)
    at kernel/qobject.cpp:2718
#32 0xb6aa432a in QAction::triggered (this=0x82ebf68, _t1=false)
    at moc_qaction.cpp:183
#33 0xb6aa4ce7 in QAction::activate (this=0x82ebf68, event=QAction::Trigger)
    at kernel/qaction.cpp:898
#34 0xb6aa8128 in QAction::trigger (this=0x82ebf68) at qaction.h:155
#35 0xb6de4a5f in QToolButton::nextCheckState (this=0x82f31a0)
    at widgets/qtoolbutton.cpp:951
#36 0xb6d2ead0 in QAbstractButtonPrivate::click (this=0x82f31b8)
    at widgets/qabstractbutton.cpp:463
#37 0xb6d2ee47 in QAbstractButton::mouseReleaseEvent (this=0x82f31a0, e=0xbf9f5874)
    at widgets/qabstractbutton.cpp:949
#38 0xb6afdc0d in QWidget::event (this=0x82f31a0, e=0xbf9f5874)
    at kernel/qwidget.cpp:4950
#39 0xb6d2e011 in QAbstractButton::event (this=0x82f31a0, e=0xbf9f5874)
    at widgets/qabstractbutton.cpp:917
#40 0xb6de4a8a in QToolButton::event (this=0x82f31a0, e=0xbf9f5874)
    at widgets/qtoolbutton.cpp:957
#41 0xb6aaac1b in QApplicationPrivate::notify_helper (this=0x81f7358,
    receiver=0x82f31a0, e=0xbf9f5874) at kernel/qapplication.cpp:3116
#42 0xb6aab6b6 in QApplication::notify (this=0x81f9628, receiver=0x82f31a0,
    e=0xbf9f5874) at kernel/qapplication.cpp:2849
#43 0xb74af796 in sipQApplication::notify (this=0x81f9628, a0=0x82f31a0,
    a1=0xbf9f5874) at sipQtGuiQApplication.cpp:176
#44 0xb6ab3d1b in QCoreApplication::sendSpontaneousEvent (receiver=0x82f31a0,
    event=0xbf9f5874) at qcoreapplication.h:174
#45 0xb6b18ec1 in QETWidget::translateMouseEvent (this=0x82f31a0, event=0xbf9f5cd0)
    at kernel/qapplication_x11.cpp:3576
#46 0xb6b16c99 in QApplication::x11ProcessEvent (this=0x81f9628, event=0xbf9f5cd0)
    at kernel/qapplication_x11.cpp:2701
#47 0xb6b2acaf in QEventDispatcherX11::processEvents (this=0x81fcb78,
    flags=@0xbf9f5d84) at kernel/qeventdispatcher_x11.cpp:112
#48 0xb7908896 in QEventLoop::processEvents (this=0xbf9f5e08, flags=@0xbf9f5dbc)
    at kernel/qeventloop.cpp:118
#49 0xb7908b21 in QEventLoop::exec (this=0xbf9f5e08, flags=@0xbf9f5e10)
    at kernel/qeventloop.cpp:158
#50 0xb790ebf3 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:661
#51 0xb6aaa2eb in QApplication::exec () at kernel/qapplication.cpp:2664
#52 0xb74b3a47 in meth_QApplication_exec_ (sipArgs=0xb7e0e034)
    at sipQtGuiQApplication.cpp:2058
#53 0x08118677 in PyCFunction_Call (func=0xb7b9461c, arg=0xb7e0e034, kw=0x0)
    at Objects/methodobject.c:73
#54 0x080cb5ad in call_function (pp_stack=0xbf9f5fa8, oparg=0) at Python/ceval.c:3445
#55 0x080c742e in eval_frame (f=0x816dd9c) at Python/ceval.c:2122
#56 0x080c97bd in PyEval_EvalCodeEx (co=0xb7b85398, globals=0xb7e2ddf4,
    locals=0xb7e2ddf4, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at Python/ceval.c:2669
#57 0x080c0150 in PyEval_EvalCode (co=0xb7b85398, globals=0xb7e2ddf4,
    locals=0xb7e2ddf4) at Python/ceval.c:537
#58 0x080f1014 in run_node (n=0xb7e24348, filename=0xbf9f7703 "mdi.py",
    globals=0xb7e2ddf4, locals=0xb7e2ddf4, flags=0xbf9f62f0)
    at Python/pythonrun.c:1267
#59 0x080f0fbe in run_err_node (n=0xb7e24348, filename=0xbf9f7703 "mdi.py",
    globals=0xb7e2ddf4, locals=0xb7e2ddf4, flags=0xbf9f62f0)
    at Python/pythonrun.c:1254
#60 0x080f0f8d in PyRun_FileExFlags (fp=0x815c008, filename=0xbf9f7703 "mdi.py",
    start=257, globals=0xb7e2ddf4, locals=0xb7e2ddf4, closeit=1, flags=0xbf9f62f0)
    at Python/pythonrun.c:1245
#61 0x080efc15 in PyRun_SimpleFileExFlags (fp=0x815c008,
    filename=0xbf9f7703 "mdi.py", closeit=1, flags=0xbf9f62f0)
    at Python/pythonrun.c:862
#62 0x080ef384 in PyRun_AnyFileExFlags (fp=0x815c008, filename=0xbf9f7703 "mdi.py",
    closeit=1, flags=0xbf9f62f0) at Python/pythonrun.c:659
#63 0x08055695 in Py_Main (argc=2, argv=0xbf9f63f4) at Modules/main.c:415
#64 0x08054d52 in main (argc=2, argv=0xbf9f63f4) at Modules/python.c:23

-- 
Don't look now, but the man in the moon is laughing at you.




More information about the PyQt mailing list