QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Signals | Public Member Functions | List of all members
QgsMapLayerAction Class Reference

An action which can run on map layers. More...

#include <qgsmaplayeractionregistry.h>

Inheritance diagram for QgsMapLayerAction:
Inheritance graph
[legend]

Public Types

enum  Target { Layer = 1, SingleFeature = 2, MultipleFeatures = 4, AllActions = Layer | SingleFeature | MultipleFeatures }
 

Signals

void triggeredForFeature (QgsMapLayer *layer, const QgsFeature &feature)
 Triggered when action has been run for a specific feature. More...
 
void triggeredForFeatures (QgsMapLayer *layer, const QList< QgsFeature > featureList)
 Triggered when action has been run for a specific list of features. More...
 
void triggeredForLayer (QgsMapLayer *layer)
 Triggered when action has been run for a specific layer. More...
 

Public Member Functions

 QgsMapLayerAction (QString name, QObject *parent, Targets targets=AllActions, QIcon icon=QIcon())
 Creates a map layer action which can run on any layer. More...
 
 QgsMapLayerAction (QString name, QObject *parent, QgsMapLayer *layer, Targets targets=AllActions, QIcon icon=QIcon())
 Creates a map layer action which can run only on a specific layer. More...
 
 QgsMapLayerAction (QString name, QObject *parent, QgsMapLayer::LayerType layerType, Targets targets=AllActions, QIcon icon=QIcon())
 Creates a map layer action which can run on a specific type of layer. More...
 
 ~QgsMapLayerAction ()
 
bool canRunUsingLayer (QgsMapLayer *layer) const
 True if action can run using the specified layer. More...
 
void setTargets (Targets targets)
 Define the targets of the action. More...
 
const Targets & targets () const
 Return availibity of action. More...
 
void triggerForFeature (QgsMapLayer *layer, const QgsFeature *feature)
 Triggers the action with the specified layer and feature. More...
 
void triggerForFeatures (QgsMapLayer *layer, const QList< QgsFeature > featureList)
 Triggers the action with the specified layer and list of feature. More...
 
void triggerForLayer (QgsMapLayer *layer)
 Triggers the action with the specified layer. More...
 
- Public Member Functions inherited from QAction
 QAction (QObject *parent)
 
 QAction (const QString &text, QObject *parent)
 
 QAction (QObject *parent, const char *name)
 
 QAction (const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
 QAction (const QIcon &icon, const QString &text, QObject *parent)
 
 QAction (const QIcon &icon, const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
 ~QAction ()
 
QKeySequence accel () const
 
QActionGroupactionGroup () const
 
void activate (ActionEvent event)
 
void activated (int i)
 
bool addTo (QWidget *w)
 
QList< QGraphicsWidget * > associatedGraphicsWidgets () const
 
QList< QWidget * > associatedWidgets () const
 
bool autoRepeat () const
 
void changed ()
 
QVariant data () const
 
QFont font () const
 
void hover ()
 
void hovered ()
 
QIcon icon () const
 
QIcon iconSet () const
 
QString iconText () const
 
bool isCheckable () const
 
bool isChecked () const
 
bool isEnabled () const
 
bool isIconVisibleInMenu () const
 
bool isOn () const
 
bool isSeparator () const
 
bool isToggleAction () const
 
bool isVisible () const
 
QMenumenu () const
 
MenuRole menuRole () const
 
QString menuText () const
 
QWidgetparentWidget () const
 
Priority priority () const
 
bool removeFrom (QWidget *w)
 
void setAccel (const QKeySequence &shortcut)
 
void setActionGroup (QActionGroup *group)
 
void setAutoRepeat (bool)
 
void setCheckable (bool)
 
void setChecked (bool)
 
void setData (const QVariant &userData)
 
void setDisabled (bool b)
 
void setEnabled (bool)
 
void setFont (const QFont &font)
 
void setIcon (const QIcon &icon)
 
void setIconSet (const QIcon &i)
 
void setIconText (const QString &text)
 
void setIconVisibleInMenu (bool visible)
 
void setMenu (QMenu *menu)
 
void setMenuRole (MenuRole menuRole)
 
void setMenuText (const QString &text)
 
void setOn (bool b)
 
void setPriority (Priority priority)
 
void setSeparator (bool b)
 
void setShortcut (const QKeySequence &shortcut)
 
void setShortcutContext (Qt::ShortcutContext context)
 
void setShortcuts (QKeySequence::StandardKey key)
 
void setShortcuts (const QList< QKeySequence > &shortcuts)
 
void setSoftKeyRole (SoftKeyRole softKeyRole)
 
void setStatusTip (const QString &statusTip)
 
void setText (const QString &text)
 
void setToggleAction (bool b)
 
void setToolTip (const QString &tip)
 
void setVisible (bool)
 
void setWhatsThis (const QString &what)
 
QKeySequence shortcut () const
 
Qt::ShortcutContext shortcutContext () const
 
QList< QKeySequenceshortcuts () const
 
bool showStatusText (QWidget *widget)
 
SoftKeyRole softKeyRole () const
 
QString statusTip () const
 
QString text () const
 
void toggle ()
 
void toggled (bool checked)
 
QString toolTip () const
 
void trigger ()
 
void triggered (bool checked)
 
QString whatsThis () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QAction
virtual bool event (QEvent *e)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QAction
 autoRepeat
 
 checkable
 
 checked
 
 enabled
 
 font
 
 icon
 
 iconText
 
 iconVisibleInMenu
 
 menuRole
 
 priority
 
 shortcut
 
 shortcutContext
 
 softKeyRole
 
 statusTip
 
 text
 
 toolTip
 
 visible
 
 whatsThis
 
- Properties inherited from QObject
 objectName
 

Detailed Description

An action which can run on map layers.

Definition at line 31 of file qgsmaplayeractionregistry.h.

Member Enumeration Documentation

Enumerator
Layer 
SingleFeature 
MultipleFeatures 
AllActions 

Definition at line 37 of file qgsmaplayeractionregistry.h.

Constructor & Destructor Documentation

QgsMapLayerAction::QgsMapLayerAction ( QString  name,
QObject parent,
Targets  targets = AllActions,
QIcon  icon = QIcon() 
)

Creates a map layer action which can run on any layer.

Note
using AllActions as a target probably does not make a lot of sense. This default action was settled for API compatiblity reasons.

Definition at line 19 of file qgsmaplayeractionregistry.cpp.

QgsMapLayerAction::QgsMapLayerAction ( QString  name,
QObject parent,
QgsMapLayer layer,
Targets  targets = AllActions,
QIcon  icon = QIcon() 
)

Creates a map layer action which can run only on a specific layer.

Definition at line 30 of file qgsmaplayeractionregistry.cpp.

QgsMapLayerAction::QgsMapLayerAction ( QString  name,
QObject parent,
QgsMapLayer::LayerType  layerType,
Targets  targets = AllActions,
QIcon  icon = QIcon() 
)

Creates a map layer action which can run on a specific type of layer.

Definition at line 41 of file qgsmaplayeractionregistry.cpp.

QgsMapLayerAction::~QgsMapLayerAction ( )

Definition at line 51 of file qgsmaplayeractionregistry.cpp.

Member Function Documentation

bool QgsMapLayerAction::canRunUsingLayer ( QgsMapLayer layer) const

True if action can run using the specified layer.

Definition at line 57 of file qgsmaplayeractionregistry.cpp.

void QgsMapLayerAction::setTargets ( Targets  targets)
inline

Define the targets of the action.

Definition at line 71 of file qgsmaplayeractionregistry.h.

const Targets& QgsMapLayerAction::targets ( ) const
inline

Return availibity of action.

Definition at line 73 of file qgsmaplayeractionregistry.h.

void QgsMapLayerAction::triggeredForFeature ( QgsMapLayer layer,
const QgsFeature feature 
)
signal

Triggered when action has been run for a specific feature.

void QgsMapLayerAction::triggeredForFeatures ( QgsMapLayer layer,
const QList< QgsFeature featureList 
)
signal

Triggered when action has been run for a specific list of features.

void QgsMapLayerAction::triggeredForLayer ( QgsMapLayer layer)
signal

Triggered when action has been run for a specific layer.

void QgsMapLayerAction::triggerForFeature ( QgsMapLayer layer,
const QgsFeature feature 
)

Triggers the action with the specified layer and feature.

Definition at line 85 of file qgsmaplayeractionregistry.cpp.

void QgsMapLayerAction::triggerForFeatures ( QgsMapLayer layer,
const QList< QgsFeature featureList 
)

Triggers the action with the specified layer and list of feature.

Definition at line 80 of file qgsmaplayeractionregistry.cpp.

void QgsMapLayerAction::triggerForLayer ( QgsMapLayer layer)

Triggers the action with the specified layer.

Definition at line 90 of file qgsmaplayeractionregistry.cpp.


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