QmlDesigner: Fix the bug for adding rows to a Collection

After adding a row to the model, TableView reads the whole model except
one cell. It also ignores all the further notifications for that cell
even if we notify it explicitly. By notifying a model reset, this will
be solved.

Fixes: QDS-11248
Change-Id: I92cc7be5f82bc9acd2f9695f6f6a306ef003b78c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Ali Kianian
2023-12-14 16:55:06 +02:00
parent bc1f1c3719
commit 08d7dcc46b

View File

@@ -179,15 +179,16 @@ bool CollectionDetailsModel::setHeaderData(int section,
return headerChanged;
}
bool CollectionDetailsModel::insertRows(int row, int count, const QModelIndex &parent)
bool CollectionDetailsModel::insertRows(int row, int count, [[maybe_unused]] const QModelIndex &parent)
{
if (count < 1)
return false;
row = qBound(0, row, rowCount());
beginInsertRows(parent, row, row + count);
beginResetModel();
m_currentCollection.insertEmptyElements(row, count);
endInsertRows();
endResetModel();
selectRow(row);
return true;