QGIS API Documentation
3.28.14-Firenze (exported)
Loading...
Searching...
No Matches
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_sip.h
"
21
22
#include "
qgsfeature.h
"
23
#include "
qgsaction.h
"
24
#include "qgis_gui.h"
25
#include "
qgsattributeform.h
"
26
27
class
QgsMapLayer
;
28
class
QgsMapLayerAction
;
29
class
QgsVectorLayer
;
30
class
QgsActionManager
;
31
37
class
GUI_EXPORT
QgsActionMenu
:
public
QMenu
38
{
39
Q_OBJECT
40
41
public
:
42
enum
ActionType
43
{
44
Invalid
,
45
MapLayerAction
,
46
AttributeAction
47
};
48
49
struct
GUI_EXPORT
ActionData
50
{
51
55
ActionData
() =
default
;
56
ActionData
(
const
QgsAction
&action,
QgsFeatureId
featureId,
QgsMapLayer
*mapLayer );
57
ActionData
(
QgsMapLayerAction
*action,
QgsFeatureId
featureId,
QgsMapLayer
*mapLayer );
58
59
QgsActionMenu::ActionType
actionType = Invalid;
60
QVariant
actionData
;
61
QgsFeatureId
featureId = 0;
62
QgsMapLayer
*mapLayer =
nullptr
;
63
};
64
74
explicit
QgsActionMenu
(
QgsVectorLayer
*layer,
const
QgsFeature
&feature,
const
QString &actionScope, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
75
84
explicit
QgsActionMenu
(
QgsVectorLayer
*layer,
QgsFeatureId
fid,
const
QString &actionScope, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
85
92
void
setFeature(
const
QgsFeature
&feature );
93
99
void
setMode(
QgsAttributeEditorContext::Mode
mode );
100
106
void
setExpressionContextScope(
const
QgsExpressionContextScope
&scope );
107
113
QgsExpressionContextScope
expressionContextScope()
const
;
114
120
QList<QgsAction> menuActions();
121
127
bool
isEmpty()
const
;
128
129
signals:
130
void
reinit
();
131
132
private
slots:
133
void
triggerAction();
134
void
reloadActions();
135
void
layerWillBeDeleted();
136
137
private
:
138
void
init();
139
QgsFeature
feature();
140
141
QgsVectorLayer
*mLayer =
nullptr
;
142
int
mVisibleActionCount = 0;
143
QList<QgsAction> mActions;
144
QgsFeature
mFeature;
145
QgsFeatureId
mFeatureId;
146
QString mActionScope;
147
QgsExpressionContextScope
mExpressionContextScope;
148
QgsAttributeEditorContext::Mode
mMode =
QgsAttributeEditorContext::SingleEditMode
;
149
};
150
151
152
Q_DECLARE_METATYPE
(
QgsActionMenu::ActionData
)
153
154
#endif
// QGSACTIONMENU_H
QgsActionManager
Storage and management of actions associated with a layer.
Definition
qgsactionmanager.h:53
QgsActionMenu
This class is a menu that is populated automatically with the actions defined for a given layer.
Definition
qgsactionmenu.h:38
QgsActionMenu::ActionType
ActionType
Definition
qgsactionmenu.h:43
QgsActionMenu::Invalid
@ Invalid
Invalid.
Definition
qgsactionmenu.h:44
QgsActionMenu::MapLayerAction
@ MapLayerAction
Standard actions (defined by core or plugins)
Definition
qgsactionmenu.h:45
QgsActionMenu::reinit
void reinit()
QgsAction
Utility class that encapsulates an action based on vector attributes.
Definition
qgsaction.h:35
QgsAttributeEditorContext::Mode
Mode
modes
Definition
qgsattributeeditorcontext.h:48
QgsAttributeEditorContext::SingleEditMode
@ SingleEditMode
Single edit mode, for editing a single feature.
Definition
qgsattributeeditorcontext.h:49
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext.
Definition
qgsexpressioncontext.h:114
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:56
QgsMapLayerAction
An action which can run on map layers The class can be used in two manners:
Definition
qgsmaplayeractionregistry.h:39
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:73
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition
qgsvectorlayer.h:392
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:53
qgsaction.h
qgsattributeform.h
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
qgsfeature.h
QgsFeatureId
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition
qgsfeatureid.h:28
QgsActionMenu::ActionData
Definition
qgsactionmenu.h:50
QgsActionMenu::ActionData::ActionData
ActionData()=default
Constructor for ActionData.
QgsActionMenu::ActionData::actionData
QVariant actionData
Definition
qgsactionmenu.h:60
Generated on Sat Dec 23 2023 15:24:23 for QGIS API Documentation by
1.9.8