Important: Please read the Qt Code of Conduct -

C++ (PyQt5) object set on property value not deleted after overwriting with QQuickItem::setProperty

  • Consider a Qml component with property var mine: Mine {} at the root level using a Mine QObject class defined in C++ (or rather Python via PyQt5). If I overwrite that mine property with QQuickItem::setProperty, that default Mine object seems to not be deleted. I tested this by printing a value from a timer started with QObject::startTimer from the Mine C++ definition.

    How is object deletion handled in Qml? Shouldn't the default value be deleting when I overwrite that property value with ```QQuickItem::setProperty````. Or maybe this has more to do with python keeping a reference around?

Log in to reply