QGIS API Documentation
4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
src
core
editform
qgsattributeeditoraction.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsattributeeditoraction.h - QgsAttributeEditorAction
3
4
---------------------
5
begin : 14.8.2021
6
copyright : (C) 2021 by Alessandro Pasotti
7
email : elpaso at itopen dot it
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSATTRIBUTEEDITORACTION_H
17
#define QGSATTRIBUTEEDITORACTION_H
18
19
#include "qgis_core.h"
20
#include "
qgsaction.h
"
21
#include "
qgsattributeeditorelement.h
"
22
28
class
CORE_EXPORT
QgsAttributeEditorAction
:
public
QgsAttributeEditorElement
29
{
30
public
:
37
QgsAttributeEditorAction
(
const
QgsAction
&
action
,
QgsAttributeEditorElement
*
parent
);
38
46
QgsAttributeEditorAction
(
const
QUuid &uuid,
QgsAttributeEditorElement
*
parent
);
47
48
QgsAttributeEditorElement
*
clone
(
QgsAttributeEditorElement
*
parent
)
const
override
SIP_FACTORY
;
49
53
const
QgsAction
&
action
(
const
QgsVectorLayer
*layer )
const
;
54
58
void
setAction
(
const
QgsAction
&newAction );
59
60
private
:
61
// Lazy loaded
62
mutable
QgsAction
mAction;
63
QUuid mUuid;
64
65
// QgsAttributeEditorElement interface
66
void
saveConfiguration( QDomElement &elem, QDomDocument &doc )
const override
;
67
void
loadConfiguration(
const
QDomElement &element,
const
QString &layerId,
const
QgsReadWriteContext
&context,
const
QgsFields
&fields )
override
;
68
QString typeIdentifier()
const override
;
69
};
70
71
#endif
// QGSATTRIBUTEEDITORACTION_H
QgsAction
Utility class that encapsulates an action based on vector attributes.
Definition
qgsaction.h:38
QgsAttributeEditorAction::action
const QgsAction & action(const QgsVectorLayer *layer) const
Returns the (possibly lazy loaded) action for the given layer.
Definition
qgsattributeeditoraction.cpp:44
QgsAttributeEditorAction::QgsAttributeEditorAction
QgsAttributeEditorAction(const QgsAction &action, QgsAttributeEditorElement *parent)
Creates a new element which can display a layer action.
Definition
qgsattributeeditoraction.cpp:25
QgsAttributeEditorAction::setAction
void setAction(const QgsAction &newAction)
Set the action to newAction.
Definition
qgsattributeeditoraction.cpp:54
QgsAttributeEditorElement::parent
QgsAttributeEditorElement * parent() const
Gets the parent of this element.
Definition
qgsattributeeditorelement.h:148
QgsAttributeEditorElement::QgsAttributeEditorElement
QgsAttributeEditorElement(Qgis::AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr)
Constructor.
Definition
qgsattributeeditorelement.h:113
QgsAttributeEditorElement::clone
virtual QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const =0
Returns a clone of this element.
QgsFields
Container of fields for a vector layer.
Definition
qgsfields.h:46
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:413
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsaction.h
qgsattributeeditorelement.h
Generated on
for QGIS API Documentation by
1.15.0