QGIS API Documentation
3.2.0-Bonn (bc43194)
src
gui
qgsactionmenu.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsactionmenu.h
3
--------------------------------------
4
Date : 11.8.2014
5
Copyright : (C) 2014 Matthias Kuhn
6
Email : matthias at opengis dot ch
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSACTIONMENU_H
17
#define QGSACTIONMENU_H
18
19
#include <QMenu>
20
#include "
qgis.h
"
21
#include <QSignalMapper>
22
23
#include "
qgsfeature.h
"
24
#include "
qgsaction.h
"
25
#include "qgis_gui.h"
26
#include "
qgsattributeform.h
"
27
28
class
QgsMapLayer
;
29
class
QgsMapLayerAction
;
30
class
QgsVectorLayer
;
31
class
QgsActionManager
;
32
38
class
GUI_EXPORT
QgsActionMenu
:
public
QMenu
39
{
40
Q_OBJECT
41
42
public
:
43
enum
ActionType
44
{
45
Invalid
,
46
MapLayerAction
,
47
AttributeAction
48
};
49
50
struct
GUI_EXPORT
ActionData
51
{
52
56
ActionData
() =
default
;
57
ActionData
(
const
QgsAction
&action,
QgsFeatureId
featureId,
QgsMapLayer
*mapLayer );
58
ActionData
(
QgsMapLayerAction
*action,
QgsFeatureId
featureId,
QgsMapLayer
*mapLayer );
59
60
QgsActionMenu::ActionType
actionType = Invalid;
61
QVariant
actionData
;
62
QgsFeatureId
featureId = 0;
63
QgsMapLayer
*mapLayer =
nullptr
;
64
};
65
75
explicit
QgsActionMenu
(
QgsVectorLayer
*layer,
const
QgsFeature
&feature,
const
QString &actionScope, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
76
85
explicit
QgsActionMenu
(
QgsVectorLayer
*layer,
QgsFeatureId
fid,
const
QString &actionScope, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
86
93
void
setFeature(
const
QgsFeature
&feature );
94
100
void
setMode(
QgsAttributeForm::Mode
mode );
101
107
void
setExpressionContextScope(
const
QgsExpressionContextScope
&scope );
108
114
QgsExpressionContextScope
expressionContextScope()
const
;
115
116
signals:
117
void
reinit();
118
119
private
slots:
120
void
triggerAction();
121
void
reloadActions();
122
void
layerWillBeDeleted();
123
124
private
:
125
void
init();
126
QgsFeature
feature();
127
128
QgsVectorLayer
*mLayer =
nullptr
;
129
QList<QgsAction> mActions;
130
QgsFeature
mFeature;
131
QgsFeatureId
mFeatureId;
132
QString mActionScope;
133
QgsExpressionContextScope
mExpressionContextScope;
134
QgsAttributeForm::Mode
mMode;
135
};
136
137
138
Q_DECLARE_METATYPE
(
QgsActionMenu::ActionData
)
139
140
#endif // QGSACTIONMENU_H
QgsMapLayer
Base class for all map layer types.
Definition:
qgsmaplayer.h:61
qgsfeature.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition:
qgis_sip.h:46
QgsActionMenu::ActionType
ActionType
Definition:
qgsactionmenu.h:43
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition:
qgsfeature.h:62
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QModelIndex)
QgsActionMenu::MapLayerAction
Standard actions (defined by core or plugins)
Definition:
qgsactionmenu.h:46
QgsAttributeForm::Mode
Mode
Form modes.
Definition:
qgsattributeform.h:50
QgsActionMenu::ActionData
Definition:
qgsactionmenu.h:50
QgsActionMenu
This class is a menu that is populated automatically with the actions defined for a given layer...
Definition:
qgsactionmenu.h:38
QgsAction
Utility class that encapsulates an action based on vector attributes.
Definition:
qgsaction.h:35
QgsActionManager
Storage and management of actions associated with a layer.
Definition:
qgsactionmanager.h:51
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext.
Definition:
qgsexpressioncontext.h:129
qgsattributeform.h
QgsFeatureId
qint64 QgsFeatureId
Definition:
qgsfeature.h:37
qgis.h
qgsaction.h
QgsActionMenu::Invalid
Invalid.
Definition:
qgsactionmenu.h:45
QgsActionMenu::ActionData::actionData
QVariant actionData
Definition:
qgsactionmenu.h:61
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:353
QgsMapLayerAction
An action which can run on map layers.
Definition:
qgsmaplayeractionregistry.h:34
Generated on Sat Jun 23 2018 20:58:15 for QGIS API Documentation by
1.8.13