GAbstractView: Add function for adding all to selection

This commit is contained in:
Shannon Booth 2020-01-07 22:28:40 +13:00 committed by Andreas Kling
parent 00596296c4
commit 7cf15bcb75
Notes: sideshowbarker 2024-07-19 10:17:49 +09:00
2 changed files with 13 additions and 0 deletions

View file

@ -95,6 +95,18 @@ void GAbstractView::stop_editing()
}
}
void GAbstractView::select_all()
{
ASSERT(model());
int rows = model()->row_count();
int columns = model()->column_count();
for (int i = 0; i < rows; ++i) {
for (int j = 0; j < columns; ++j)
selection().add(model()->index(i, j));
}
}
void GAbstractView::activate(const GModelIndex& index)
{
if (on_activation)