QgsIdentifyMenu class

The QgsIdentifyMenu class builds a menu to be used with identify results (.

Constructors, destructors, conversion operators

QgsIdentifyMenu(QgsMapCanvas* canvas) explicit
QgsIdentifyMenu is a menu to be used to choose within a list of QgsMapTool::IdentifyReults.

Public functions

void addCustomAction(QgsMapLayerAction* action)
adds a new custom action to the menu
auto exec(const QList<QgsMapToolIdentify::IdentifyResult>& idResults, QPoint pos) -> QList<QgsMapToolIdentify::IdentifyResult>
exec
auto expressionContextScope() const -> QgsExpressionContextScope
Returns an expression context scope used to resolve underlying actions.
void removeCustomActions()
remove all custom actions from the menu to be built
void setAllowMultipleReturn(bool multipleReturn)
define if the menu executed can return multiple results (e.g. all results or all identified features of a vector layer)
void setExecWithSingleResult(bool execWithSingleResult)
define if the menu will be shown with a single identify result
void setExpressionContextScope(const QgsExpressionContextScope& scope)
Sets an expression context scope used to resolve underlying actions.
void setMaxFeatureDisplay(int maxFeatureDisplay)
Defines the maximum number of features displayed in the menu for vector layers (default is 10).
void setMaxLayerDisplay(int maxLayerDisplay)
Defines the maximum number of layers displayed in the menu (default is 10).
void setResultsIfExternalAction(bool resultsIfExternalAction)
setResultsIfExternalAction if set to false (default) the menu will not return any results if an external action has been triggered
void setShowFeatureActions(bool showFeatureActions)
define if attribute actions(1) and map layer actions(2) can be listed and run from the menu

Function documentation

QList<QgsMapToolIdentify::IdentifyResult> QgsIdentifyMenu::exec(const QList<QgsMapToolIdentify::IdentifyResult>& idResults, QPoint pos)

exec

Parameters
idResults the list of identify results to choose within
pos the position where the menu will be executed

QgsExpressionContextScope QgsIdentifyMenu::expressionContextScope() const

Returns an expression context scope used to resolve underlying actions.

void QgsIdentifyMenu::setExpressionContextScope(const QgsExpressionContextScope& scope)

Sets an expression context scope used to resolve underlying actions.

void QgsIdentifyMenu::setMaxFeatureDisplay(int maxFeatureDisplay)

Defines the maximum number of features displayed in the menu for vector layers (default is 10).

void QgsIdentifyMenu::setMaxLayerDisplay(int maxLayerDisplay)

Defines the maximum number of layers displayed in the menu (default is 10).

void QgsIdentifyMenu::setResultsIfExternalAction(bool resultsIfExternalAction)

setResultsIfExternalAction if set to false (default) the menu will not return any results if an external action has been triggered

void QgsIdentifyMenu::setShowFeatureActions(bool showFeatureActions)

define if attribute actions(1) and map layer actions(2) can be listed and run from the menu