From de93f795fbe4d0140a74399f5449bcf2cc9dcefd Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 6 Aug 2020 19:26:30 +0200 Subject: [PATCH] [ui] CsvData: declare Qt parent --- meshroom/ui/components/csvData.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meshroom/ui/components/csvData.py b/meshroom/ui/components/csvData.py index f6b00c1133..6d00a42cd5 100644 --- a/meshroom/ui/components/csvData.py +++ b/meshroom/ui/components/csvData.py @@ -8,9 +8,9 @@ class CsvData(QObject): """Store data from a CSV file.""" - def __init__(self): + def __init__(self, parent=None): """Initialize the object without any parameter.""" - super(CsvData, self).__init__() + super(CsvData, self).__init__(parent=parent) self._filepath = "" self._data = QObjectListModel(parent=self) # List of CsvColumn self._ready = False @@ -60,7 +60,7 @@ def read(self): # Create the objects in dataList # with the first line elements as objects' title for elt in csvRows[0]: - dataList.append(CsvColumn(elt)) + dataList.append(CsvColumn(elt, parent=self._data)) # Populate the content attribute for elt in csvRows[1:]: @@ -78,9 +78,9 @@ def read(self): class CsvColumn(QObject): """Store content of a CSV column.""" - def __init__(self, title=""): + def __init__(self, title="", parent=None): """Initialize the object with optional column title parameter.""" - super(CsvColumn, self).__init__() + super(CsvColumn, self).__init__(parent=parent) self._title = title self._content = []