PDA

View Full Version : Qt plug-in for GLib event loop based application



profoX
13th June 2008, 14:02
I am working on a PyQt 4 front-end for a python application that uses the GLib event loop itself. How should I fix it so that it works? Right now I get this Python GDB backtrace when I try to process something with the python core application after the GUI is loaded (and the Qt event loop is running)


login.py, __init__
login.py, show
login.py, signin
Signing in to account
65.54.239.210
login.py, onConnecting: Connecting to server...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fb7cc4986e0 (LWP 21603)]
0x00000000004d44bd in PyFrame_New ()
(gdb) bt
#0 0x00000000004d44bd in PyFrame_New ()
#1 0x0000000000489c76 in PyEval_EvalCodeEx ()
#2 0x00000000004d51f8 in ?? ()
#3 0x00000000004191ea in ?? ()
#4 0x000000000041b370 in _PyObject_CallFunction_SizeT ()
#5 0x00007fb7ca9a7233 in ?? () from /var/lib/python-support/python2.5/gtk-2.0/gobject/_gobject.so
#6 0x00007fb7ca0af262 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#7 0x00007fb7ca0b2516 in ?? () from /usr/lib/libglib-2.0.so.0
#8 0x00007fb7ca0b29af in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#9 0x00007fb7c3e423af in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#10 0x00007fb7c435f72f in ?? () from /usr/lib/libQtGui.so.4
#11 0x00007fb7c3e18585 in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#12 0x00007fb7c3e186db in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#13 0x00007fb7c3e1a729 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#14 0x00007fb7c5141c87 in ?? () from /usr/lib/python2.5/site-packages/PyQt4/QtGui.so
#15 0x00000000004895bb in PyEval_EvalFrameEx ()
#16 0x0000000000488b77 in PyEval_EvalFrameEx ()
#17 0x0000000000488b77 in PyEval_EvalFrameEx ()
#18 0x000000000048a376 in PyEval_EvalCodeEx ()
#19 0x000000000048a492 in PyEval_EvalCode ()
#20 0x00000000004abdce in PyRun_FileExFlags ()
#21 0x00000000004ac069 in PyRun_SimpleFileExFlags ()
#22 0x00000000004145ad in Py_Main ()
#23 0x00007fb7cb6bd1c4 in __libc_start_main () from /lib/libc.so.6
#24 0x0000000000413b29 in _start ()
(gdb)

Do I have to use the GLib event loop in PyQt4? I'm lost.
Thanks. I hope someone can help me.

wysota
14th June 2008, 15:27
This backtrace shows the program fails on Python (or PyQt) code, not Glib code. I don't think the event loop has anything to do with this.