QGIS API Documentation
3.99.0-Master (d270888f95f)
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
#include <QString>
20
21
using namespace
Qt::StringLiterals;
22
23
QgsAttributeEditorElement
*
QgsAttributeEditorSpacerElement::clone
(
QgsAttributeEditorElement
*
parent
)
const
24
{
25
return
new
QgsAttributeEditorSpacerElement
(
name
(),
parent
);
26
}
27
28
void
QgsAttributeEditorSpacerElement::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
29
{
30
Q_UNUSED( doc );
31
elem.setAttribute( u
"drawLine"
_s, mDrawLine ? 1 : 0 );
32
}
33
34
void
QgsAttributeEditorSpacerElement::loadConfiguration(
const
QDomElement &element,
const
QString &layerId,
const
QgsReadWriteContext
&context,
const
QgsFields
&fields )
35
{
36
// Nothing to load
37
Q_UNUSED( layerId );
38
Q_UNUSED( context );
39
Q_UNUSED( fields );
40
41
bool
ok;
42
const
bool
drawLine
= element.attribute( u
"drawLine"
_s ).toInt( &ok );
43
if
( ok )
44
mDrawLine =
drawLine
;
45
}
46
47
QString QgsAttributeEditorSpacerElement::typeIdentifier()
const
48
{
49
return
u
"attributeEditorSpacerElement"
_s;
50
}
51
52
bool
QgsAttributeEditorSpacerElement::drawLine
()
const
53
{
54
return
mDrawLine;
55
}
56
57
void
QgsAttributeEditorSpacerElement::setDrawLine
(
bool
drawLine
)
58
{
59
mDrawLine =
drawLine
;
60
}
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:57
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:23
QgsAttributeEditorSpacerElement::drawLine
bool drawLine() const
Returns true if the spacer element will contain an horizontal line.
Definition
qgsattributeeditorspacerelement.cpp:52
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
qgsattributeeditorspacerelement.h
Generated on
for QGIS API Documentation by
1.15.0