QGIS API Documentation
3.41.0-Master (af5edcb665c)
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
#include <QDomText>
18
19
QgsAttributeEditorElement
*
QgsAttributeEditorHtmlElement::clone
(
QgsAttributeEditorElement
*parent )
const
20
{
21
QgsAttributeEditorHtmlElement
*element =
new
QgsAttributeEditorHtmlElement
(
name
(),
parent
);
22
element->
setHtmlCode
( mHtmlCode );
23
24
return
element;
25
}
26
27
QString
QgsAttributeEditorHtmlElement::htmlCode
()
const
28
{
29
return
mHtmlCode;
30
}
31
32
void
QgsAttributeEditorHtmlElement::setHtmlCode
(
const
QString &htmlCode )
33
{
34
mHtmlCode =
htmlCode
;
35
}
36
37
void
QgsAttributeEditorHtmlElement::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
38
{
39
const
QDomText codeElem = doc.createTextNode( mHtmlCode );
40
elem.appendChild( codeElem );
41
}
42
43
void
QgsAttributeEditorHtmlElement::loadConfiguration(
const
QDomElement &element,
const
QString &layerId,
const
QgsReadWriteContext
&context,
const
QgsFields
&fields )
44
{
45
Q_UNUSED( layerId )
46
Q_UNUSED( context )
47
Q_UNUSED( fields )
48
setHtmlCode
( element.text() );
49
}
50
51
QString QgsAttributeEditorHtmlElement::typeIdentifier()
const
52
{
53
return
QStringLiteral(
"attributeEditorHtmlElement"
);
54
}
55
QgsAttributeEditorElement
This is an abstract base class for any elements of a drag and drop form.
Definition
qgsattributeeditorelement.h:43
QgsAttributeEditorElement::parent
QgsAttributeEditorElement * parent() const
Gets the parent of this element.
Definition
qgsattributeeditorelement.h:147
QgsAttributeEditorElement::name
QString name() const
Returns the name of this element.
Definition
qgsattributeeditorelement.h:134
QgsAttributeEditorHtmlElement
An attribute editor widget that will represent arbitrary HTML code.
Definition
qgsattributeeditorhtmlelement.h:31
QgsAttributeEditorHtmlElement::htmlCode
QString htmlCode() const
The Html code that will be represented within this widget.
Definition
qgsattributeeditorhtmlelement.cpp:27
QgsAttributeEditorHtmlElement::setHtmlCode
void setHtmlCode(const QString &htmlCode)
Sets the HTML code that will be represented within this widget to htmlCode.
Definition
qgsattributeeditorhtmlelement.cpp:32
QgsAttributeEditorHtmlElement::clone
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
Definition
qgsattributeeditorhtmlelement.cpp:19
QgsFields
Container of fields for a vector layer.
Definition
qgsfields.h:46
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition
qgsreadwritecontext.h:34
qgsattributeeditorhtmlelement.h
Generated on Thu Dec 26 2024 02:19:01 for QGIS API Documentation by
1.9.8