QGIS API Documentation
3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
src
core
editform
qgsattributeeditorspacerelement.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsattributeeditorspacerelement.cpp - QgsAttributeEditorSpacerElement
3
4
---------------------
5
begin : 16.1.2023
6
copyright : (C) 2023 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
#include "
qgsattributeeditorspacerelement.h
"
17
18
#include <QDomElement>
19
20
QgsAttributeEditorElement
*
QgsAttributeEditorSpacerElement::clone
(
QgsAttributeEditorElement
*
parent
)
const
21
{
22
return
new
QgsAttributeEditorSpacerElement
(
name
(),
parent
);
23
}
24
25
void
QgsAttributeEditorSpacerElement::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
26
{
27
Q_UNUSED( doc );
28
elem.setAttribute( QStringLiteral(
"drawLine"
), mDrawLine ? 1 : 0 );
29
}
30
31
void
QgsAttributeEditorSpacerElement::loadConfiguration(
const
QDomElement &element,
const
QString &layerId,
const
QgsReadWriteContext
&context,
const
QgsFields
&fields )
32
{
33
// Nothing to load
34
Q_UNUSED( layerId );
35
Q_UNUSED( context );
36
Q_UNUSED( fields );
37
38
bool
ok;
39
const
bool
drawLine
= element.attribute( QStringLiteral(
"drawLine"
) ).toInt( &ok );
40
if
( ok )
41
mDrawLine =
drawLine
;
42
}
43
44
QString QgsAttributeEditorSpacerElement::typeIdentifier()
const
45
{
46
return
QStringLiteral(
"attributeEditorSpacerElement"
);
47
}
48
49
bool
QgsAttributeEditorSpacerElement::drawLine
()
const
50
{
51
return
mDrawLine;
52
}
53
54
void
QgsAttributeEditorSpacerElement::setDrawLine
(
bool
drawLine
)
55
{
56
mDrawLine =
drawLine
;
57
}
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:115
QgsAttributeEditorElement::name
QString name() const
Returns the name of this element.
Definition
qgsattributeeditorelement.h:135
QgsAttributeEditorSpacerElement::setDrawLine
void setDrawLine(bool drawLine)
Sets a flag to define if the spacer element will contain an horizontal line.
Definition
qgsattributeeditorspacerelement.cpp:54
QgsAttributeEditorSpacerElement::QgsAttributeEditorSpacerElement
QgsAttributeEditorSpacerElement(const QString &name, QgsAttributeEditorElement *parent)
Creates a new element which represents a spacer.
Definition
qgsattributeeditorspacerelement.h:38
QgsAttributeEditorSpacerElement::clone
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
Definition
qgsattributeeditorspacerelement.cpp:20
QgsAttributeEditorSpacerElement::drawLine
bool drawLine() const
Returns true if the spacer element will contain an horizontal line.
Definition
qgsattributeeditorspacerelement.cpp:49
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:34
qgsattributeeditorspacerelement.h
Generated on
for QGIS API Documentation by
1.15.0