Skip to content
Permalink
Browse files
Double click to add single layer
  • Loading branch information
nyalldawson committed Jul 12, 2021
1 parent 5e41371 commit 1321b33dde5da40fd32de0a63fe8ed801251efff
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/app/qgsprovidersublayersdialog.cpp
@@ -157,7 +157,14 @@ QgsProviderSublayersDialog::QgsProviderSublayersDialog( const QString &uri, cons
connect( mBtnDeselectAll, &QAbstractButton::pressed, this, [ = ] { mLayersTree->selectionModel()->clear(); } );
connect( mLayersTree->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsProviderSublayersDialog::treeSelectionChanged );
connect( mSearchLineEdit, &QgsFilterLineEdit::textChanged, mProxyModel, &QgsProviderSublayerProxyModel::setFilterString );

connect( mLayersTree, &QTreeView::doubleClicked, this, [ = ]( const QModelIndex & index )
{
mLayersTree->selectionModel()->select( QItemSelection( mLayersTree->model()->index( index.row(), 0, index.parent() ),
mLayersTree->model()->index( index.row(), mLayersTree->model()->columnCount() - 1, index.parent() ) ),
QItemSelectionModel::ClearAndSelect );
emit layersAdded( selectedLayers() );
accept();
} );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( mButtonBox, &QDialogButtonBox::accepted, this, [ = ]
{

0 comments on commit 1321b33

Please sign in to comment.