QGIS API Documentation
3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
src
core
editform
qgsattributeeditorhtmlelement.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsattributeeditorhtmlelement.cpp - QgsAttributeEditorHtmlelement
3
4
---------------------
5
begin : 12.01.2021
6
copyright : (C) 2021 by Denis Rouzaud
7
email :
[email protected]
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 "
qgsattributeeditorhtmlelement.h
"
17
18
#include <QDomText>
19
20
QgsAttributeEditorElement
*
QgsAttributeEditorHtmlElement::clone
(
QgsAttributeEditorElement
*
parent
)
const
21
{
22
QgsAttributeEditorHtmlElement
*element =
new
QgsAttributeEditorHtmlElement
(
name
(),
parent
);
23
element->
setHtmlCode
( mHtmlCode );
24
25
return
element;
26
}
27
28
QString
QgsAttributeEditorHtmlElement::htmlCode
()
const
29
{
30
return
mHtmlCode;
31
}
32
33
void
QgsAttributeEditorHtmlElement::setHtmlCode
(
const
QString &
htmlCode
)
34
{
35
mHtmlCode =
htmlCode
;
36
}
37
38
void
QgsAttributeEditorHtmlElement::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
39
{
40
const
QDomText codeElem = doc.createTextNode( mHtmlCode );
41
elem.appendChild( codeElem );
42
}
43
44
void
QgsAttributeEditorHtmlElement::loadConfiguration(
const
QDomElement &element,
const
QString &layerId,
const
QgsReadWriteContext
&context,
const
QgsFields
&fields )
45
{
46
Q_UNUSED( layerId )
47
Q_UNUSED( context )
48
Q_UNUSED( fields )
49
setHtmlCode
( element.text() );
50
}
51
52
QString QgsAttributeEditorHtmlElement::typeIdentifier()
const
53
{
54
return
QStringLiteral(
"attributeEditorHtmlElement"
);
55
}
56
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
QgsAttributeEditorHtmlElement::htmlCode
QString htmlCode() const
The Html code that will be represented within this widget.
Definition
qgsattributeeditorhtmlelement.cpp:28
QgsAttributeEditorHtmlElement::QgsAttributeEditorHtmlElement
QgsAttributeEditorHtmlElement(const QString &name, QgsAttributeEditorElement *parent)
Creates a new element which can display HTML.
Definition
qgsattributeeditorhtmlelement.h:38
QgsAttributeEditorHtmlElement::setHtmlCode
void setHtmlCode(const QString &htmlCode)
Sets the HTML code that will be represented within this widget to htmlCode.
Definition
qgsattributeeditorhtmlelement.cpp:33
QgsAttributeEditorHtmlElement::clone
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
Definition
qgsattributeeditorhtmlelement.cpp:20
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
qgsattributeeditorhtmlelement.h
Generated on
for QGIS API Documentation by
1.15.0