Skip to content

Commit

Permalink
Leave parent default QAbstractItemModel
Browse files Browse the repository at this point in the history
The parent in the createIndex function from QAbstractItemModel refers to a
datamodel, not a GUI component. Setting it incorrectly results in ASSERT
failure in the QAbstractItemView::setModel.

Fixed a minor bug with defaults for iteration number as well
  • Loading branch information
lars-petter-hauge committed Jun 6, 2019
1 parent 0f51950 commit 06f635a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ert_gui/ertwidgets/models/all_cases_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self):
self.__data = []

def index(self, row, column, parent=None, *args, **kwargs):
return self.createIndex(row, column, parent)
return self.createIndex(row, column)

def parent(self, index=None):
return QModelIndex()
Expand Down
2 changes: 1 addition & 1 deletion ert_gui/tools/load_results/load_results_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def getIterationCount():
iteration = 0
valid_directory = True
while valid_directory:
formatted = run_path % (0, iteration)
formatted = run_path % (0, iteration + 1)
valid_directory = os.path.exists(formatted)
if valid_directory:
iteration += 1
Expand Down
2 changes: 1 addition & 1 deletion ert_gui/tools/plot/data_type_keys_list_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def keyManager(self):
return self.__ert.getKeyManager()

def index(self, row, column, parent=None, *args, **kwargs):
return self.createIndex(row, column, parent)
return self.createIndex(row, column)

def parent(self, index=None):
return QModelIndex()
Expand Down

0 comments on commit 06f635a

Please sign in to comment.