Fix retrieving list of selected columns for Browse Data tab

When retrieving the list of selected columns of a table in the Browse
Data tab only take into account columns which are selected entirely, not
columns which have at least a single selected field. Before selecting a
row would implicity select all columns.

This fixes issues with resizing and with hiding a column.

See issue #1999.
This commit is contained in:
Martin Kleusberg
2019-09-22 22:36:04 +02:00
parent a69c62790f
commit 845875ae19

View File

@@ -844,7 +844,7 @@ int ExtendedTableWidget::numVisibleRows() const
std::unordered_set<int> ExtendedTableWidget::selectedCols() const
{
std::unordered_set<int> selectedCols;
for(const QModelIndex & idx : selectedIndexes())
for(const auto& idx : selectionModel()->selectedColumns())
selectedCols.insert(idx.column());
return selectedCols;
}