@@ -66,7 +66,35 @@ class QUICK_EXPORT QgsQuickIdentifyKit : public QObject
66
66
*/
67
67
Q_PROPERTY ( int featuresLimit READ featuresLimit WRITE setFeaturesLimit NOTIFY featuresLimitChanged )
68
68
69
+ /* *
70
+ * Defines behavior of the identify tool (See description of IdentifyMode enum).
71
+ *
72
+ * Default is TopDownAll.
73
+ */
74
+ Q_PROPERTY ( IdentifyMode identifyMode MEMBER mIdentifyMode NOTIFY identifyModeChanged )
75
+
69
76
public:
77
+
78
+ /* *
79
+ * IdentifyMode enums used to define identify tool behavior on identifiable layers.
80
+ */
81
+ enum IdentifyMode
82
+ {
83
+
84
+ /* *
85
+ * Identification is performed from top to bottom down layers returning all
86
+ * identified features;
87
+ */
88
+ TopDownAll = 0 ,
89
+
90
+ /* *
91
+ * Identification is performed from top to bottom down layers and stops on the first layer
92
+ * returning non-empty list of identified features. Identification on rest layers is skipped.
93
+ */
94
+ TopDownStopAtFirst
95
+ };
96
+ Q_ENUM ( IdentifyMode )
97
+
70
98
// ! Constructor of new identify kit.
71
99
explicit QgsQuickIdentifyKit ( QObject *parent = nullptr );
72
100
@@ -91,8 +119,10 @@ class QUICK_EXPORT QgsQuickIdentifyKit : public QObject
91
119
/* *
92
120
* Gets the closest feature to the point within the search radius
93
121
*
94
- * If layer is nullptr, identifies the closest feature from all identifiable layers
95
- * If layer is not nullptr, identifies the closest feature from given layer
122
+ * If layer is nullptr, identifies the closest feature from either
123
+ * all identifiable layers (IdentifyMode::TopDownAll) or the first layer from top to bottom layers
124
+ * with non-empty identified feature list (IdentifyMode::TopDownStopAtFirst)
125
+ * If layer is not nullptr, identifies the closest feature from given layer regardless identify mode.
96
126
*
97
127
* To modify search radius, use QgsQuickIdentifyKit::searchRadiusMm
98
128
*
@@ -104,8 +134,10 @@ class QUICK_EXPORT QgsQuickIdentifyKit : public QObject
104
134
/* *
105
135
* Gets all features in the search radius
106
136
*
107
- * If layer is nullptr, identifies features from all identifiable layers
108
- * If layer is not nullptr, identifies only features from given layer
137
+ * If layer is nullptr, identifies features from either
138
+ * all identifiable layers (IdentifyMode::TopDownAll) or the first layer from top to bottom layers
139
+ * with non-empty identified feature list (IdentifyMode::TopDownStopAtFirst)
140
+ * If layer is not nullptr, identifies only features from given layer regardless identify mode.
109
141
*
110
142
* To limit number of results, use QgsQuickIdentifyKit::featuresLimit
111
143
* To modify search radius, use QgsQuickIdentifyKit::searchRadiusMm
@@ -122,6 +154,8 @@ class QUICK_EXPORT QgsQuickIdentifyKit : public QObject
122
154
void searchRadiusMmChanged ();
123
155
// ! \copydoc QgsQuickIdentifyKit::featuresLimit
124
156
void featuresLimitChanged ();
157
+ // ! \copydoc QgsQuickIdentifyKit::identifyMode
158
+ void identifyModeChanged ();
125
159
126
160
private:
127
161
QgsQuickMapSettings *mMapSettings = nullptr ; // not owned
@@ -134,6 +168,7 @@ class QUICK_EXPORT QgsQuickIdentifyKit : public QObject
134
168
135
169
double mSearchRadiusMm = 8 ;
136
170
int mFeaturesLimit = 100 ;
171
+ IdentifyMode mIdentifyMode = IdentifyMode::TopDownAll;
137
172
};
138
173
139
174
#endif // QGSQUICKIDENTIFYKIT_H
0 commit comments