Skip to content

Commit a3ea2ad

Browse files
committed
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.
1 parent b0d5506 commit a3ea2ad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gui/attributetable/qgsfeaturelistview.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ void QgsFeatureListView::ensureEditSelection()
342342
|| mModel->mapFromMaster( selectedIndexes.first() ).row() == -1 )
343343
&& mModel->rowCount() )
344344
{
345-
mCurrentEditSelectionModel->select( mModel->mapToMaster( mModel->index( 0, 0 ) ), QItemSelectionModel::Select );
345+
QTimer::singleShot( 0, this, [ this ]()
346+
{
347+
setEditSelection( mModel->mapToMaster( mModel->index( 0, 0 ) ), QItemSelectionModel::ClearAndSelect );
348+
} );
346349
}
347350
}
348351

0 commit comments

Comments
 (0)