Update TaskManager when node is removed

This commit is contained in:
Lee Geertsen 2019-09-06 11:02:45 +02:00 committed by Yann Lanthony
parent 6d83985b39
commit 34a90563c8
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642
3 changed files with 66 additions and 16 deletions

View file

@ -1,5 +1,5 @@
from PySide2 import QtCore
import shiboken2
class QObjectListModel(QtCore.QAbstractListModel):
"""
@ -272,7 +272,7 @@ class QObjectListModel(QtCore.QAbstractListModel):
def _dereferenceItem(self, item):
# Ask for object deletion if parented to the model
if item.parent() == self:
if shiboken2.isValid(item) and item.parent() == self:
# delay deletion until the next event loop
# This avoids warnings when the QML engine tries to evaluate (but should not)
# an object that has already been deleted