Skip to content
Permalink
Browse files

avoid extra calls to clearing the selection

  • Loading branch information
3nids committed Mar 19, 2021
1 parent 64553db commit e9036bbe2f807b77f231669cf6fc687b9ff0e40c
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/gui/symbology/qgssvgselectorwidget.cpp
@@ -404,9 +404,12 @@ QgsSvgSelectorWidget::QgsSvgSelectorWidget( QWidget *parent )

connect( mSvgFilterLineEdit, &QgsFilterLineEdit::textChanged, this, [ = ]( const QString & filterText )
{
disconnect( mImagesListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsSvgSelectorWidget::svgSelectionChanged );
mImagesListView->selectionModel()->clearSelection();
connect( mImagesListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsSvgSelectorWidget::svgSelectionChanged );
if ( mImagesListView->selectionModel()->selectedIndexes().count() > 0 )
{
disconnect( mImagesListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsSvgSelectorWidget::svgSelectionChanged );
mImagesListView->selectionModel()->clearSelection();
connect( mImagesListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsSvgSelectorWidget::svgSelectionChanged );
}
qobject_cast<QgsSvgSelectorFilterModel *>( mImagesListView->model() )->setFilterFixedString( filterText );
} );

0 comments on commit e9036bb

Please sign in to comment.