17 #include <QStandardItem>
31 mFilterLineEdit->setShowClearButton(
true );
32 mFilterLineEdit->setShowSearchIcon(
true );
35 listMapLayers->setModel( mModel );
36 const QModelIndex firstLayer = mModel->index( 0, 0 );
37 listMapLayers->selectionModel()->select( firstLayer, QItemSelectionModel::Select );
39 connect( listMapLayers, &QListView::doubleClicked,
this, &QgsLayoutLegendLayersDialog::accept );
42 connect( mCheckBoxVisibleLayers, &QCheckBox::toggled,
this, &QgsLayoutLegendLayersDialog::filterVisible );
43 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsLayoutLegendLayersDialog::showHelp );
45 mFilterLineEdit->setFocus();
50 mVisibleLayers = layers;
55 QList< QgsMapLayer * > layers;
57 const QModelIndexList selection = listMapLayers->selectionModel()->selectedIndexes();
58 for (
const QModelIndex &index : selection )
60 const QModelIndex sourceIndex = mModel->mapToSource( index );
61 if ( !sourceIndex.isValid() )
73 void QgsLayoutLegendLayersDialog::filterVisible(
bool enabled )
81 void QgsLayoutLegendLayersDialog::showHelp()
83 QgsHelp::openHelp( QStringLiteral(
"print_composer/composer_items/composer_legend.html#legend-items" ) );