QgsQuickIdentifyKit class
Convenient set of tools to identify features.
Contents
- get a list of features in a defined radius from a point.
- get a feature with the closest distance to the point
Public types
- enum IdentifyMode { TopDownAll = 0, TopDownStopAtFirst }
- IdentifyMode enums used to define identify tool behavior on identifiable layers.
Constructors, destructors, conversion operators
- QgsQuickIdentifyKit(QObject* parent = nullptr) explicit
- Constructor of new identify kit.
Public functions
- auto featuresLimit() const -> int
- Maximum number of features returned from the QgsQuickIdentifyKit::
identify() - auto identify(const QPointF& point, QgsVectorLayer* layer = nullptr) -> Q_INVOKABLE QgsQuickFeatureLayerPairs
- Gets all features in the search radius.
- auto identifyOne(const QPointF& point, QgsVectorLayer* layer = nullptr) -> Q_INVOKABLE QgsQuickFeatureLayerPair
- Gets the closest feature to the point within the search radius.
- auto mapSettings() const -> QgsQuickMapSettings*
- Map settings.
- auto searchRadiusMm() const -> double
- Search radius for the identify functions.
- void setFeaturesLimit(int limit)
- Maximum number of features returned from the QgsQuickIdentifyKit::
identify() - void setMapSettings(QgsQuickMapSettings* mapSettings)
- Map settings.
- void setSearchRadiusMm(double searchRadiusMm)
- Search radius for the identify functions.
Signals
- void featuresLimitChanged()
- Maximum number of features returned from the QgsQuickIdentifyKit::
identify() - void identifyModeChanged()
- Defines behavior of the identify tool (See description of IdentifyMode enum).
- void mapSettingsChanged()
- Map settings.
- void searchRadiusMmChanged()
- Search radius for the identify functions.
Enum documentation
enum QgsQuickIdentifyKit:: IdentifyMode
IdentifyMode enums used to define identify tool behavior on identifiable layers.
| Enumerators | |
|---|---|
| TopDownAll |
Identification is performed from top to bottom down layers returning all identified features;. |
| TopDownStopAtFirst |
Identification is performed from top to bottom down layers and stops on the first layer returning non-empty list of identified features. Identification on rest layers is skipped. |
Function documentation
int QgsQuickIdentifyKit:: featuresLimit() const
Maximum number of features returned from the QgsQuickIdentifyKit::
Default is 100.
Q_INVOKABLE QgsQuickFeatureLayerPairs QgsQuickIdentifyKit:: identify(const QPointF& point,
QgsVectorLayer* layer = nullptr)
Gets all features in the search radius.
| Parameters | |
|---|---|
| point | position to search features ob |
| layer | if defined, search for features only from this layer |
If layer is nullptr, identifies features from either all identifiable layers (IdentifyMode::TopDownAll) or the first layer from top to bottom layers with non-empty identified feature list (IdentifyMode::TopDownStopAtFirst) If layer is not nullptr, identifies only features from given layer regardless identify mode.
To limit number of results, use QgsQuickIdentifyKit::
Q_INVOKABLE QgsQuickFeatureLayerPair QgsQuickIdentifyKit:: identifyOne(const QPointF& point,
QgsVectorLayer* layer = nullptr)
Gets the closest feature to the point within the search radius.
| Parameters | |
|---|---|
| point | position to search a feature from |
| layer | if defined, search for a feature only from this layer |
If layer is nullptr, identifies the closest feature from either all identifiable layers (IdentifyMode::TopDownAll) or the first layer from top to bottom layers with non-empty identified feature list (IdentifyMode::TopDownStopAtFirst) If layer is not nullptr, identifies the closest feature from given layer regardless identify mode.
To modify search radius, use QgsQuickIdentifyKit::
QgsQuickMapSettings* QgsQuickIdentifyKit:: mapSettings() const
Map settings.
Set directly when creating QML object.
double QgsQuickIdentifyKit:: searchRadiusMm() const
Search radius for the identify functions.
Default is 8.
void QgsQuickIdentifyKit:: setFeaturesLimit(int limit)
Maximum number of features returned from the QgsQuickIdentifyKit::
Default is 100.
void QgsQuickIdentifyKit:: setMapSettings(QgsQuickMapSettings* mapSettings)
Map settings.
Set directly when creating QML object.
void QgsQuickIdentifyKit:: setSearchRadiusMm(double searchRadiusMm)
Search radius for the identify functions.
Default is 8.
void QgsQuickIdentifyKit:: featuresLimitChanged() signal
Maximum number of features returned from the QgsQuickIdentifyKit::
Default is 100.
void QgsQuickIdentifyKit:: identifyModeChanged() signal
Defines behavior of the identify tool (See description of IdentifyMode enum).
Default is TopDownAll.
void QgsQuickIdentifyKit:: mapSettingsChanged() signal
Map settings.
Set directly when creating QML object.
void QgsQuickIdentifyKit:: searchRadiusMmChanged() signal
Search radius for the identify functions.
Default is 8.