[PyKDE] Re: Q___Style wrapper

Mike Rovner mrovner at cadence.com
Sat May 6 00:35:48 BST 2006


Phil Thompson wrote:
>>> On Thursday 04 May 2006 10:32 pm, Mike Rovner wrote:
>>>> I need to wrap custom QMyStyle C++ class.
> So you need to create a SIP wrapper for it.

Right. I did so and it's working fine.
However I got a crash on exit:

(gdb) where
#0  PyThreadState_New (interp=0x0) at Python/pystate.c:194
#1  0x080d993c in PyGILState_Ensure () at Python/pystate.c:489
#2  0xb62cfdf5 in initsip ()
    from /home/mrovner/tools/linux-x86_32/lib/python2.4/site-packages/sip.so
#3  0xb5d43739 in initQtGui ()
    from 
/home/mrovner/tools/linux-x86_32/lib/python2.4/site-packages/PyQt4/QtGui.so
#4  0xb57f9410 in QApplication::~QApplication() ()
    from /lan/dfm/grp_mm_data1/dev/tools/linux-x86_32/lib/libQtGui.so.4
#5  0xb5fd3f21 in initQtGui ()
    from 
/home/mrovner/tools/linux-x86_32/lib/python2.4/site-packages/PyQt4/QtGui.so
#6  0xb5d2b359 in ?? ()
    from 
/home/mrovner/tools/linux-x86_32/lib/python2.4/site-packages/PyQt4/QtGui.so
#7  0xb62cdfa9 in initsip ()
    from /home/mrovner/tools/linux-x86_32/lib/python2.4/site-packages/sip.so
#8  0x080db5dd in call_ll_exitfuncs () at Python/pythonrun.c:1564
#9  0x080db61b in Py_Exit (sts=1) at Python/pythonrun.c:1573
#10 0x080dc8ad in handle_system_exit () at Python/pythonrun.c:1041
#11 0x080daba5 in PyErr_PrintEx (set_sys_last_vars=1) at 
Python/pythonrun.c:1051
#12 0x080da892 in PyErr_Print () at Python/pythonrun.c:965
#13 0x080da7d8 in PyRun_SimpleFileExFlags (fp=0x8146008, 
filename=0xbffff3a8 "main.ui.py",
     closeit=1, flags=0xbfffd964) at Python/pythonrun.c:864
#14 0x08055538 in Py_Main (argc=1, argv=0xbfffda14) at Modules/main.c:484
#15 0x08054f8b in main (argc=1, argv=0x1) at Modules/python.c:23

It seems to me that that finalization code is not (my)style specific.
Without using that style all is fine. Style itself is well debugged and 
used extensively in other (pure C++) applications.

I use it in a simple matter:

if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)
     app.setStyle(QtGui.QMyStyle())
     MainWindow = QtGui.QMainWindow()
     ui = Ui_MainWindow()
     ui.setupUi(MainWindow)
     MainWindow.show()
     sys.exit(app.exec_())

Any leads how to debug it?

Thanks,
Mike




More information about the PyQt mailing list