QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
editform
qgsattributeeditortextelement.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsattributeeditortextelement.cpp - QgsAttributeEditorTextelement
3
4
---------------------
5
begin : 28.12.2022
6
copyright : (C) 2022 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 "
qgsattributeeditortextelement.h
"
17
18
#include <QDomText>
19
#include <QString>
20
21
using namespace
Qt::StringLiterals;
22
23
QgsAttributeEditorElement
*
QgsAttributeEditorTextElement::clone
(
QgsAttributeEditorElement
*
parent
)
const
24
{
25
QgsAttributeEditorTextElement
*element =
new
QgsAttributeEditorTextElement
(
name
(),
parent
);
26
element->
setText
( mText );
27
28
return
element;
29
}
30
31
QString
QgsAttributeEditorTextElement::text
()
const
32
{
33
return
mText;
34
}
35
36
void
QgsAttributeEditorTextElement::setText
(
const
QString &
text
)
37
{
38
mText =
text
;
39
}
40
41
void
QgsAttributeEditorTextElement::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
42
{
43
const
QDomText textElem = doc.createTextNode( mText );
44
elem.appendChild( textElem );
45
}
46
47
void
QgsAttributeEditorTextElement::loadConfiguration(
const
QDomElement &element,
const
QString &layerId,
const
QgsReadWriteContext
&context,
const
QgsFields
&fields )
48
{
49
Q_UNUSED( layerId )
50
Q_UNUSED( context )
51
Q_UNUSED( fields )
52
setText
( element.text() );
53
}
54
55
QString QgsAttributeEditorTextElement::typeIdentifier()
const
56
{
57
return
u
"attributeEditorTextElement"
_s;
58
}
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::name
QString name() const
Returns the name of this element.
Definition
qgsattributeeditorelement.h:135
QgsAttributeEditorTextElement::clone
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
Definition
qgsattributeeditortextelement.cpp:23
QgsAttributeEditorTextElement::setText
void setText(const QString &text)
Sets the text that will be represented within this widget to text.
Definition
qgsattributeeditortextelement.cpp:36
QgsAttributeEditorTextElement::text
QString text() const
The Text that will be represented within this widget.
Definition
qgsattributeeditortextelement.cpp:31
QgsAttributeEditorTextElement::QgsAttributeEditorTextElement
QgsAttributeEditorTextElement(const QString &name, QgsAttributeEditorElement *parent)
Creates a new element which can display text.
Definition
qgsattributeeditortextelement.h:37
QgsFields
Container of fields for a vector layer.
Definition
qgsfields.h:45
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
qgsattributeeditortextelement.h
Generated on
for QGIS API Documentation by
1.17.0