QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
QgsIdentifyMenu Class Reference

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

#include <qgsidentifymenu.h>

Classes

struct  ActionData
class  CustomActionRegistry

Public Types

enum  MenuLevel { LayerLevel, FeatureLevel }

Public Member Functions

 QgsIdentifyMenu (QgsMapCanvas *canvas)
 QgsIdentifyMenu is a menu to be used to choose within a list of QgsMapTool::IdentifyReults.
 ~QgsIdentifyMenu ()
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)
bool allowMultipleReturn ()
void setExecWithSingleResult (bool execWithSingleResult)
 define if the menu will be shown with a single idetify result
bool execWithSingleResult ()
void setShowFeatureActions (bool showFeatureActions)
 define if attribute actions(1) and map layer actions(2) can be listed and run from the menu
bool showFeatureActions ()
void setResultsIfExternalAction (bool resultsIfExternalAction)
 setResultsIfExternalAction if set to false (default) the menu will not return any results if an external action has been triggered
bool resultsIfExternalAction ()
void setMaxLayerDisplay (int maxLayerDisplay)
 Defines the maximimum number of layers displayed in the menu (default is 10).
int maxLayerDisplay ()
void setMaxFeatureDisplay (int maxFeatureDisplay)
 Defines the maximimum number of features displayed in the menu for vector layers (default is 10).
int maxFeatureDisplay ()
void addCustomAction (QgsMapLayerAction *action)
 adds a new custom action to the menu
void removeCustomActions ()
 remove all custom actions from the menu to be built
QList
< QgsMapToolIdentify::IdentifyResult
exec (const QList< QgsMapToolIdentify::IdentifyResult > idResults, QPoint pos)
 exec

Protected Member Functions

virtual void closeEvent (QCloseEvent *e)

Detailed Description

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

See Also
QgsMapToolIdentify). It is customizable and can display attribute actions (
QgsAttributeAction) as well as map layer actions (
QgsMapLayerAction). It can also embed custom map layer actions, defined for this menu exclusively. If used in a QgsMapToolIdentify, it is accessible via QgsMapToolIdentify::identifyMenu() and can be customized in the map tool sub-class.

Member Enumeration Documentation

Enumerator:
LayerLevel 
FeatureLevel 

Constructor & Destructor Documentation

QgsIdentifyMenu::QgsIdentifyMenu ( QgsMapCanvas canvas)
explicit

QgsIdentifyMenu is a menu to be used to choose within a list of QgsMapTool::IdentifyReults.

QgsIdentifyMenu::~QgsIdentifyMenu ( )

Member Function Documentation

void QgsIdentifyMenu::addCustomAction ( QgsMapLayerAction action)
inline

adds a new custom action to the menu

bool QgsIdentifyMenu::allowMultipleReturn ( )
inline
void QgsIdentifyMenu::closeEvent ( QCloseEvent *  e)
protectedvirtual
QList< QgsMapToolIdentify::IdentifyResult > QgsIdentifyMenu::exec ( const QList< QgsMapToolIdentify::IdentifyResult idResults,
QPoint  pos 
)

exec

Parameters
idResultsthe list of identify results to choose within
posthe position where the menu will be executed
bool QgsIdentifyMenu::execWithSingleResult ( )
inline
int QgsIdentifyMenu::maxFeatureDisplay ( )
inline
int QgsIdentifyMenu::maxLayerDisplay ( )
inline
void QgsIdentifyMenu::removeCustomActions ( )

remove all custom actions from the menu to be built

bool QgsIdentifyMenu::resultsIfExternalAction ( )
inline
void QgsIdentifyMenu::setAllowMultipleReturn ( bool  multipleReturn)
inline

define if the menu executed can return multiple results (e.g. all results or all identified features of a vector layer)

void QgsIdentifyMenu::setExecWithSingleResult ( bool  execWithSingleResult)
inline

define if the menu will be shown with a single idetify result

void QgsIdentifyMenu::setMaxFeatureDisplay ( int  maxFeatureDisplay)

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

Note
0 is unlimited.
void QgsIdentifyMenu::setMaxLayerDisplay ( int  maxLayerDisplay)

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

Note
0 is unlimited.
void QgsIdentifyMenu::setResultsIfExternalAction ( bool  resultsIfExternalAction)
inline

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

Note
external action can be either custom actions or feature / map layer actions (
See Also
setShowFeatureActions)
void QgsIdentifyMenu::setShowFeatureActions ( bool  showFeatureActions)
inline

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

Note
custom actions will be shown in any case if they exist.
(1) attribute actions are defined by the user in the layer properties
See Also
QgsAttributeAction
Note
(2) map layer actions are built-in c++ actions or actions which are defined by a python plugin
See Also
QgsMapLayerActionRegistry
bool QgsIdentifyMenu::showFeatureActions ( )
inline

The documentation for this class was generated from the following files: