Skip to content

Commit

Permalink
[ui] CsvData: declare Qt parent
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiencastan committed Aug 6, 2020
1 parent 9e7cb58 commit de93f79
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions meshroom/ui/components/csvData.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:]:
Expand All @@ -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 = []

Expand Down

0 comments on commit de93f79

Please sign in to comment.