34 mFilterLineEdit->setShowClearButton(
true );
35 mFilterLineEdit->setShowSearchIcon(
true );
38 listMapLayers->setModel( mModel );
39 const QModelIndex firstLayer = mModel->index( 0, 0 );
40 listMapLayers->selectionModel()->select( firstLayer, QItemSelectionModel::Select );
42 connect( listMapLayers, &QListView::doubleClicked,
this, &QgsLayoutLegendLayersDialog::accept );
45 connect( mCheckBoxVisibleLayers, &QCheckBox::toggled,
this, &QgsLayoutLegendLayersDialog::filterVisible );
46 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsLayoutLegendLayersDialog::showHelp );
48 mFilterLineEdit->setFocus();
58 QList<QgsMapLayer *> layers;
60 const QModelIndexList selection = listMapLayers->selectionModel()->selectedIndexes();
61 for (
const QModelIndex &index : selection )
63 const QModelIndex sourceIndex = mModel->mapToSource( index );
64 if ( !sourceIndex.isValid() )
69 QgsMapLayer *layer = mModel->sourceLayerModel()->layerFromIndex( sourceIndex );