[PySide] Segfault when exposing Python to QML

Seth Less mr.seth.less at gmail.com
Thu Dec 13 04:51:36 CET 2012


I'm running into issues where Python objects (subclasses of QObject and
other QT classes) that are exposed to QML (through a QDeclarativeView) will
often cause a segfault when they are accessed by QML. I think this is
because the Python objects are being garbage collected on the Python side.
(I assume this is because PySide doesn't do reference counting on objects
used by QML. Is this true?)

I "fixed" this (more like worked around it temporary) by creating a global
object cache that never deallocates any of the objects in question. As
expected, this is unacceptable as it creates memory bloat as the program
execution time increases.

What is the recommended way of using our objects in QML and not having to
store all of them permanently?

Thanks for feed back. I'm enjoying PySIde and looking to get more into it!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20121212/79972999/attachment.html>

More information about the PySide mailing list