Skip to content

Commit

Permalink
Fix NATV.visibleRows getting out of sync with column sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Jul 23, 2024
1 parent c45f92c commit a9d9ee0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions source/app/ui/qml/Graphia/Controls/NodeAttributeTableView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,15 @@ Item
id: proxyModel
columnNames: root.model.columnNames
sourceModel: root.model

function refreshVisibleRows()
{
let allProxyRows = [...Array(proxyModel.rowCount()).keys()];
let newVisibleRows = allProxyRows.map(row => proxyModel.mapToSourceRow(row));
root.visibleRows = newVisibleRows;
}

onSortOrderChanged: { refreshVisibleRows(); }
}

columnWidthProvider: function(col)
Expand Down Expand Up @@ -1261,10 +1270,7 @@ Item
function onSelectionChanged()
{
proxyModel.reset();

let allProxyRows = [...Array(proxyModel.rowCount()).keys()];
let newVisibleRows = allProxyRows.map(row => proxyModel.mapToSourceRow(row));
root.visibleRows = newVisibleRows;
proxyModel.refreshVisibleRows();

let newSelectedRows = Utils.arrayIntersection(root.selectedRows, root.visibleRows);
root.clearAndSelectRows(newSelectedRows);
Expand Down

0 comments on commit a9d9ee0

Please sign in to comment.