|
QGIS API Documentation 4.1.0-Master (4aad578bf8d)
|
The QgsMapToolSelectUtils namespace containing methods which are useful for the select maptool widgets. More...
Classes | |
| class | QgsMapToolSelectMenuActions |
| Handles actions which can be displayed in a context menu related to feature selection. More... | |
Functions | |
| QgsRectangle GUI_EXPORT | expandSelectRectangle (QgsPointXY mapPoint, QgsMapCanvas *canvas, QgsMapLayer *layer) |
| Expands a point to a rectangle with minimum size for selection based on the layer. | |
| QgsMapLayer * | getCurrentTargetLayer (QgsMapCanvas *canvas) |
| Get the current selected canvas map layer. | |
| QgsFeatureIds | getMatchingFeatures (QgsMapCanvas *canvas, const QgsGeometry &selectGeometry, bool doContains, bool singleSelect) |
| Calculates a list of features matching a selection geometry and flags. | |
| void | selectMultipleFeatures (QgsMapCanvas *canvas, const QgsGeometry &selectGeometry, Qt::KeyboardModifiers modifiers) |
| Selects multiple matching features from within currently selected layer. | |
| void | selectSingleFeature (QgsMapCanvas *canvas, const QgsGeometry &selectGeometry, Qt::KeyboardModifiers modifiers) |
| Selects a single feature from within currently selected layer. | |
| void GUI_EXPORT | setRubberBand (QgsMapCanvas *canvas, QRect &selectRect, QgsRubberBand *rubberBand) |
| Sets a QgsRubberband to rectangle in map units using a rectangle defined in device coords. | |
| void | setSelectedFeatures (QgsMapCanvas *canvas, const QgsGeometry &selectGeometry, Qgis::SelectBehavior selectBehavior=Qgis::SelectBehavior::SetSelection, bool doContains=true, bool singleSelect=false) |
| Selects the features within currently selected layer. | |
The QgsMapToolSelectUtils namespace containing methods which are useful for the select maptool widgets.
| QgsRectangle QgsMapToolSelectUtils::expandSelectRectangle | ( | QgsPointXY | mapPoint, |
| QgsMapCanvas * | canvas, | ||
| QgsMapLayer * | layer ) |
Expands a point to a rectangle with minimum size for selection based on the layer.
| mapPoint | The point to expand the rectangle around (in map coordinates) |
| canvas | The map canvas used to transform between canvas and map units |
| layer | The target layer |
Definition at line 104 of file qgsmaptoolselectutils.cpp.
| QgsMapLayer * QgsMapToolSelectUtils::getCurrentTargetLayer | ( | QgsMapCanvas * | canvas | ) |
Get the current selected canvas map layer.
Returns nullptr if it is not a selectable layer
| canvas | The map canvas used for getting the current layer |
Definition at line 53 of file qgsmaptoolselectutils.cpp.
| QgsFeatureIds QgsMapToolSelectUtils::getMatchingFeatures | ( | QgsMapCanvas * | canvas, |
| const QgsGeometry & | selectGeometry, | ||
| bool | doContains, | ||
| bool | singleSelect ) |
Calculates a list of features matching a selection geometry and flags.
| canvas | the map canvas used to get the current selected vector layer and for any required geometry transformations |
| selectGeometry | the geometry to select the layers features. This geometry must be in terms of the canvas coordinate system. |
| doContains | features will only be selected if fully contained within the selection rubber band (otherwise intersection is enough). |
| singleSelect | only selects the closest feature to the selectGeometry. |
Definition at line 359 of file qgsmaptoolselectutils.cpp.
| void QgsMapToolSelectUtils::selectMultipleFeatures | ( | QgsMapCanvas * | canvas, |
| const QgsGeometry & | selectGeometry, | ||
| Qt::KeyboardModifiers | modifiers ) |
Selects multiple matching features from within currently selected layer.
| canvas | the map canvas used to get the current selected vector layer and for any required geometry transformations |
| selectGeometry | the geometry to select the layers features. This geometry must be in terms of the canvas coordinate system. |
| modifiers | Keyboard modifiers are used to determine the current selection operations (add, subtract, contains) |
Definition at line 154 of file qgsmaptoolselectutils.cpp.
| void QgsMapToolSelectUtils::selectSingleFeature | ( | QgsMapCanvas * | canvas, |
| const QgsGeometry & | selectGeometry, | ||
| Qt::KeyboardModifiers | modifiers ) |
Selects a single feature from within currently selected layer.
| canvas | the map canvas used to get the current selected vector layer and for any required geometry transformations |
| selectGeometry | the geometry to select the layers features. This geometry must be in terms of the canvas coordinate system. |
| modifiers | Keyboard modifiers are used to determine the current selection operations (add, subtract, contains) |
Definition at line 215 of file qgsmaptoolselectutils.cpp.
| void QgsMapToolSelectUtils::setRubberBand | ( | QgsMapCanvas * | canvas, |
| QRect & | selectRect, | ||
| QgsRubberBand * | rubberBand ) |
Sets a QgsRubberband to rectangle in map units using a rectangle defined in device coords.
| canvas | The map canvas used to transform the rectangle into map units |
| selectRect | The input rectangle in device coords |
| rubberBand | The rubberband that will be set in map units using the input rectangle |
Definition at line 86 of file qgsmaptoolselectutils.cpp.
| void QgsMapToolSelectUtils::setSelectedFeatures | ( | QgsMapCanvas * | canvas, |
| const QgsGeometry & | selectGeometry, | ||
| Qgis::SelectBehavior | selectBehavior = Qgis::SelectBehavior::SetSelection, | ||
| bool | doContains = true, | ||
| bool | singleSelect = false ) |
Selects the features within currently selected layer.
| canvas | the map canvas used to get the current selected vector layer and for any required geometry transformations |
| selectGeometry | the geometry to select the layers features. This geometry must be in terms of the canvas coordinate system. |
| selectBehavior | behavior of select (ie replace selection, add to selection) |
| doContains | features will only be selected if fully contained within the selection rubber band (otherwise intersection is enough). |
| singleSelect | only selects the closest feature to the selectGeometry. |
Definition at line 302 of file qgsmaptoolselectutils.cpp.