Skip to content
Permalink
Browse files

Delayed update of edit selection

When the attribute table opens, the first entry is selected. For some
unknown reason, the selection does not appear in the feature list.
Posting this to the next run of the event loop with a timer fixes this
problem.
  • Loading branch information
m-kuhn committed May 3, 2018
1 parent b0d5506 commit a3ea2addeb6732da189129d5dd6ca7d37ac7ac2b
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/attributetable/qgsfeaturelistview.cpp
@@ -342,7 +342,10 @@ void QgsFeatureListView::ensureEditSelection()
|| mModel->mapFromMaster( selectedIndexes.first() ).row() == -1 )
&& mModel->rowCount() )
{
mCurrentEditSelectionModel->select( mModel->mapToMaster( mModel->index( 0, 0 ) ), QItemSelectionModel::Select );
QTimer::singleShot( 0, this, [ this ]()
{
setEditSelection( mModel->mapToMaster( mModel->index( 0, 0 ) ), QItemSelectionModel::ClearAndSelect );
} );
}
}

0 comments on commit a3ea2ad

Please sign in to comment.
You can’t perform that action at this time.