QGIS API Documentation
3.43.0-Master (b60ef06885e)
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Functions
a
b
c
d
f
g
h
i
l
m
n
o
p
r
s
t
w
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Symbols
3
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
Files
File List
File Members
All
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
e
f
g
h
i
l
n
o
p
q
r
s
t
w
Typedefs
3
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
Loading...
Searching...
No Matches
src
gui
actions
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 "
qgsattributeeditorcontext.h
"
24
#include "
qgsaction.h
"
25
#include "qgis_gui.h"
26
27
class
QgsMapLayer
;
28
class
QgsMapLayerAction
;
29
class
QgsVectorLayer
;
30
class
QgsActionManager
;
31
class
QgsMapLayerActionContextGenerator
;
32
37
class
GUI_EXPORT
QgsActionMenu
:
public
QMenu
38
{
39
Q_OBJECT
40
41
public
:
42
struct
GUI_EXPORT
ActionData
43
{
44
ActionData
() =
default
;
45
ActionData
(
const
QgsAction
&action,
QgsFeatureId
featureId,
QgsMapLayer
*mapLayer );
46
ActionData
(
QgsMapLayerAction
*action,
QgsFeatureId
featureId,
QgsMapLayer
*mapLayer );
47
48
Qgis::ActionType
actionType =
Qgis::ActionType::Invalid
;
49
QVariant
actionData
;
50
QgsFeatureId
featureId = 0;
51
QgsMapLayer
*mapLayer =
nullptr
;
52
};
42
struct
GUI_EXPORT
ActionData
{
…
};
53
63
explicit
QgsActionMenu
(
QgsVectorLayer
*layer,
const
QgsFeature
&feature,
const
QString &actionScope, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
64
73
explicit
QgsActionMenu
(
QgsVectorLayer
*layer,
QgsFeatureId
fid,
const
QString &actionScope, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
74
82
void
setActionContextGenerator(
QgsMapLayerActionContextGenerator
*generator );
83
90
void
setFeature(
const
QgsFeature
&feature );
91
97
void
setMode(
QgsAttributeEditorContext::Mode
mode );
98
103
void
setExpressionContextScope(
const
QgsExpressionContextScope
&scope );
104
109
QgsExpressionContextScope
expressionContextScope()
const
;
110
116
QList<QgsAction> menuActions();
117
123
bool
isEmpty()
const
;
124
125
signals:
126
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
QgsMapLayerActionContextGenerator
*mContextGenerator =
nullptr
;
151
};
37
class
GUI_EXPORT
QgsActionMenu
:
public
QMenu {
…
};
152
153
154
Q_DECLARE_METATYPE
(
QgsActionMenu::ActionData
)
155
156
#endif
// QGSACTIONMENU_H
Qgis::ActionType
ActionType
Action types.
Definition
qgis.h:4440
Qgis::ActionType::Invalid
@ Invalid
Invalid.
QgsActionManager
Storage and management of actions associated with a layer.
Definition
qgsactionmanager.h:52
QgsActionMenu
A menu that is populated automatically with the actions defined for a given layer.
Definition
qgsactionmenu.h:38
QgsActionMenu::reinit
void reinit()
Emitted after actions have been reloaded.
QgsAction
Utility class that encapsulates an action based on vector attributes.
Definition
qgsaction.h:37
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:116
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:58
QgsMapLayerActionContextGenerator
An interface for objects which can create a QgsMapLayerActionContext.
Definition
qgsmaplayeractioncontextgenerator.h:32
QgsMapLayerAction
An action which can run on map layers.
Definition
qgsmaplayeraction.h:44
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:77
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:401
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:53
qgsaction.h
qgsattributeeditorcontext.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:43
QgsActionMenu::ActionData::ActionData
ActionData()=default
QgsActionMenu::ActionData::actionData
QVariant actionData
Definition
qgsactionmenu.h:49
Generated on Sun Apr 6 2025 18:57:15 for QGIS API Documentation by
1.9.8