Skip to content

Commit

Permalink
Delayed update of edit selection
Browse files Browse the repository at this point in the history
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 a3ea2ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/attributetable/qgsfeaturelistview.cpp
Expand Up @@ -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 );
} );
}
}

Expand Down

0 comments on commit a3ea2ad

Please sign in to comment.