[Qgis-developer] QgsMapLayerAction and QgsAttributeAction

Matthias Kuhn matthias.kuhn at gmx.ch
Mon Aug 11 08:25:10 PDT 2014


Hi,

I am currently working on a better integration of actions into the
attribute dialog and the feature list on the attribute table in the form
view.

While working on this, I stumbled upon the class QgsMapLayerAction which
I am having a hard time to understand the purpose of.

Some comments in qgsdualview.cpp suggest that it is related to user
defined actions vs standard actions [1]. I wondered also if it is
related to vector layer vs raster layer (as QgsMapLayer is a common base
class of the two and QgsMapLayerAction therefore might be interpreted as
"also valid for raster layers").

What I am currently building is a gui component QgsAttributeActionMenu
that will generate a QMenu based on a layer and feature (and an optional
attribute index) that can be shown as context menu (map canvas,
attribute table, feature list) or in a menu bar of the attribute dialog.
It would be nice that this class can encapsulate any logic to fetch
possible actions from different sources (some flags could be used to
enable/disable certain actions based on the context such as "open
feature form" which doesn't make sense if it's shown in a feature form
(attribute dialog) window's menubar).

I am happy about any hint I get on this,
Best regards,
Matthias

[1]
https://github.com/qgis/QGIS/blob/master/src/gui/attributetable/qgsdualview.cpp#L324


More information about the Qgis-developer mailing list