Set parents for all QObjects

This commit is contained in:
miruka
2019-04-22 14:24:45 -04:00
parent 6664fc29e3
commit 34d2bd233d
10 changed files with 25 additions and 25 deletions

View File

@@ -6,9 +6,11 @@ from .list_model import ListModel
class ListModelMap(QObject):
def __init__(self, models_container: Callable[..., MutableSequence] = list
def __init__(self,
parent: QObject,
models_container: Callable[..., MutableSequence] = list
) -> None:
super().__init__()
super().__init__(parent)
# Set the parent to prevent item garbage-collection on the C++ side
self.dict: DefaultDict[Any, ListModel] = \