Skip to content

Commit 4c65a9d

Browse files
boutinbJorisGoosen
authored andcommitted
Do not use source when initialROwCount is used for a Simple TableView
1 parent 6e831b2 commit 4c65a9d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

QMLComponents/controls/tableviewbase.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ void TableViewBase::setUpModel()
4949
case ModelType::Simple : _tableModel = new ListModelTableViewBase( this ); break;
5050
}
5151

52+
if (modelType() == ModelType::Simple &&_initialRowCount > 0)
53+
// Per default the rows are set by the source, and if no source is specified, it sets automatically the dataset as source.
54+
// But if initialRowCount is used, it means that this table sets its own rows, so no source is needed.
55+
_tableModel->setNeedsSource(false);
5256
JASPListControl::setUpModel();
5357

5458
connect(_tableModel, &ListModelTableViewBase::columnCountChanged, this, &TableViewBase::columnCountChanged);

0 commit comments

Comments
 (0)