[PyKDE] Embedded Python problems

Jan L. Nauta jln at magentammt.com
Mon May 5 14:58:01 BST 2003


Hi,

Qt 3.1.2
Python 2.2.2
Sip/PyQt 3.6
Visual C++ 6.0 SP5

I have a C++ Qt application in which I have embedded Python to provide
external wizards. After upgrading to the above configuration from a really
old configuration (Qt 2.3.2, Python 2.1.3 and ancient Sip/PyQt) the wizards
started crashing constantly. It appears that Python objects aren't destroyed
correctly, probably because there are references from the C++ code still
lingering. i.e. Normally, in C++, I set the parent of a dialog to
qApp.mainWidget(). This crashes horribly in Python, the next time a Python
function is called. If after the dlg.exec_loop() I do a manual
qApp.mainWidget().removeChild(dlg), everything appears normal. Then I
noticed other crashes, with QPainters attached to QWidgets...

To make a long story short: Are there people doing similar things that work
correctly? How do you do that?

Any help, hints, insights, would be greatly appreciated,

Regards, jln




More information about the PyQt mailing list