29 : QDialog( parent, Qt::Window )
37 mDualView->setFeatureSelectionManager( mFeatureSelection );
42 mFeatureFilterWidget->init( vl, context, mDualView, mMessageBar, 5 );
43 mFeatureFilterWidget->filterVisible();
45 connect( mActionExpressionSelect, &QAction::triggered,
this, &QgsFeatureSelectionDlg::mActionExpressionSelect_triggered );
46 connect( mActionSelectAll, &QAction::triggered,
this, &QgsFeatureSelectionDlg::mActionSelectAll_triggered );
47 connect( mActionInvertSelection, &QAction::triggered,
this, &QgsFeatureSelectionDlg::mActionInvertSelection_triggered );
48 connect( mActionRemoveSelection, &QAction::triggered,
this, &QgsFeatureSelectionDlg::mActionRemoveSelection_triggered );
50 connect( mActionSelectedToTop, &QAction::toggled,
this, [
this](
bool checked ) { mDualView->setSelectedOnTop( checked ); } );
51 connect( mActionZoomMapToSelectedRows, &QAction::triggered,
this, &QgsFeatureSelectionDlg::mActionZoomMapToSelectedRows_triggered );
52 connect( mActionPanMapToSelectedRows, &QAction::triggered,
this, &QgsFeatureSelectionDlg::mActionPanMapToSelectedRows_triggered );
61 if ( evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return )
63 QDialog::keyPressEvent( evt );
79 QWindow *mainWindow =
nullptr;
82 if ( w->objectName() == QStringLiteral(
"QgisAppWindow" ) )
91 QSize margins( size() - scrollAreaWidgetContents->size() );
92 QSize innerWinSize( mainWindow->width(), mainWindow->height() );
93 setMaximumSize( innerWinSize );
94 QSize minSize( scrollAreaWidgetContents->sizeHint() );
95 setMinimumSize( std::min( minSize.width() + margins.width( ), innerWinSize.width() ),
96 std::min( minSize.height() + margins.width( ), innerWinSize.height() ) );
99 QDialog::showEvent( event );
102 void QgsFeatureSelectionDlg::mActionExpressionSelect_triggered()
106 dlg->setAttribute( Qt::WA_DeleteOnClose );
110 void QgsFeatureSelectionDlg::mActionInvertSelection_triggered()
115 void QgsFeatureSelectionDlg::mActionRemoveSelection_triggered()
120 void QgsFeatureSelectionDlg::mActionSelectAll_triggered()
125 void QgsFeatureSelectionDlg::mActionZoomMapToSelectedRows_triggered()
130 void QgsFeatureSelectionDlg::mActionPanMapToSelectedRows_triggered()
137 mFeatureFilterWidget->setFilterExpression( filter, type,
true );
Q_INVOKABLE void selectAll()
Select all the features.
QSet< QgsFeatureId > QgsFeatureIds
static QgsApplication * instance()
Returns the singleton instance of the QgsApplication.
void filterExpressionSet(const QString &expression, QgsAttributeForm::FilterType type)
Emitted when a filter expression is set using the view.
void toggleSearchMode(bool enabled)
Toggles whether search mode should be enabled in the form.
This class contains context information for attribute editor widgets.
void showEvent(QShowEvent *event) override
Make sure the dialog does not grow too much.
const QgsFeatureIds & selectedFeatureIds() const override
Returns reference to identifiers of selected features.
void keyPressEvent(QKeyEvent *evt) override
Q_INVOKABLE void invertSelection()
Selects not selected features and deselects selected ones.
const QgsFeatureIds & selectedFeatures()
Gets the selected features.
void removeSelection()
Clear selection.
Show a list of the features, where one can be chosen and the according attribute dialog will be prese...
void setSelectedFeatures(const QgsFeatureIds &ids) override
Change selection to the new set of features.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
void panToSelected(QgsVectorLayer *layer=nullptr)
Pan to the selected features of current (vector) layer keeping same extent.
This class offers a dialog to change feature selections.
void setMessageBar(QgsMessageBar *messageBar)
Sets the message bar to display feedback from the dialog.
void setSelectedFeatures(const QgsFeatureIds &ids)
Set the selected features.
void zoomToSelected(QgsVectorLayer *layer=nullptr)
Zoom to the extent of the selected features of provided (vector) layer.
QgsFeatureSelectionDlg(QgsVectorLayer *vl, const QgsAttributeEditorContext &context, QWidget *parent=nullptr)
Constructor for QgsFeatureSelectionDlg.
Form values are used for searching/filtering the layer.
Represents a vector layer which manages a vector based data sets.
QgsMapCanvas * mapCanvas() const
Returns the associated map canvas (e.g.
void formModeChanged(QgsAttributeEditorContext::Mode mode)
Emitted when the form changes mode.