16 #ifndef QGSIDENTIFYMENU_H
17 #define QGSIDENTIFYMENU_H
35 CustomActionRegistry() =
default;
37 void clear() { mMapLayerActionList.clear(); }
68 , mAllResults( !layer )
69 , mIsExternalAction(
nullptr != mapLayerAction )
71 , mMapLayerAction( mapLayerAction )
76 , mIsExternalAction( nullptr != mapLayerAction )
79 , mLevel( FeatureLevel )
80 , mMapLayerAction( mapLayerAction )
83 bool mIsValid =
false;
84 bool mAllResults =
false;
85 bool mIsExternalAction =
false;
110 static QList<QgsMapToolIdentify::IdentifyResult> findFeaturesOnCanvas(
QgsMapMouseEvent *event,
QgsMapCanvas *canvas,
const QList<QgsWkbTypes::GeometryType> &geometryTypes );
113 void setAllowMultipleReturn(
bool multipleReturn ) { mAllowMultipleReturn = multipleReturn;}
114 bool allowMultipleReturn() {
return mAllowMultipleReturn;}
117 void setExecWithSingleResult(
bool execWithSingleResult ) { mExecWithSingleResult = execWithSingleResult;}
118 bool execWithSingleResult() {
return mExecWithSingleResult;}
140 void setShowFeatureActions(
bool showFeatureActions ) { mShowFeatureActions = showFeatureActions; }
141 bool showFeatureActions() {
return mShowFeatureActions;}
147 void setResultsIfExternalAction(
bool resultsIfExternalAction ) {mResultsIfExternalAction = resultsIfExternalAction;}
148 bool resultsIfExternalAction() {
return mResultsIfExternalAction;}
154 void setMaxLayerDisplay(
int maxLayerDisplay );
155 int maxLayerDisplay() {
return mMaxLayerDisplay;}
161 void setMaxFeatureDisplay(
int maxFeatureDisplay );
162 int maxFeatureDisplay() {
return mMaxFeatureDisplay;}
165 void addCustomAction(
QgsMapLayerAction *action ) {mCustomActionRegistry.addMapLayerAction( action );}
168 void removeCustomActions();
175 QList<QgsMapToolIdentify::IdentifyResult> exec(
const QList<QgsMapToolIdentify::IdentifyResult> &idResults, QPoint pos );
185 void closeEvent( QCloseEvent *e )
override;
188 void handleMenuHover();
189 void deleteRubberBands();
190 void layerDestroyed();
191 void triggerMapLayerAction();
202 void addVectorLayer(
QgsVectorLayer *layer,
const QList<QgsMapToolIdentify::IdentifyResult> &results,
bool singleLayer =
false );
205 QList<QgsMapToolIdentify::IdentifyResult> results( QAction *action,
bool &externalAction );
208 QList<QgsHighlight *> mRubberBands;
209 bool mAllowMultipleReturn;
210 bool mExecWithSingleResult;
211 bool mShowFeatureActions;
212 bool mResultsIfExternalAction;
213 int mMaxLayerDisplay;
214 int mMaxFeatureDisplay;
219 QString mDefaultActionName;
222 CustomActionRegistry mCustomActionRegistry;
225 QMap <QgsMapLayer *, QList<QgsMapToolIdentify::IdentifyResult> > mLayerIdResults;
230 #endif // QGSIDENTIFYMENU_H