QGIS API Documentation
3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
src
core
editform
qgsattributeeditorqmlelement.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsattributeeditorqmlelement.cpp - QgsAttributeEditorQmlelement
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 "
qgsattributeeditorqmlelement.h
"
17
18
#include <QDomText>
19
20
QgsAttributeEditorElement
*
QgsAttributeEditorQmlElement::clone
(
QgsAttributeEditorElement
*parent )
const
21
{
22
QgsAttributeEditorQmlElement
*element =
new
QgsAttributeEditorQmlElement
(
name
(),
parent
);
23
element->
setQmlCode
( mQmlCode );
24
25
return
element;
26
}
27
28
QString
QgsAttributeEditorQmlElement::qmlCode
()
const
29
{
30
return
mQmlCode;
31
}
32
33
void
QgsAttributeEditorQmlElement::setQmlCode
(
const
QString &qmlCode )
34
{
35
mQmlCode =
qmlCode
;
36
}
37
38
void
QgsAttributeEditorQmlElement::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
39
{
40
const
QDomText codeElem = doc.createTextNode( mQmlCode );
41
elem.appendChild( codeElem );
42
}
43
44
void
QgsAttributeEditorQmlElement::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
setQmlCode
( element.text() );
50
}
51
52
QString QgsAttributeEditorQmlElement::typeIdentifier()
const
53
{
54
return
QStringLiteral(
"attributeEditorQmlElement"
);
55
}
56
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
QgsAttributeEditorQmlElement
An attribute editor widget that will represent arbitrary QML code.
Definition
qgsattributeeditorqmlelement.h:29
QgsAttributeEditorQmlElement::clone
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
Definition
qgsattributeeditorqmlelement.cpp:20
QgsAttributeEditorQmlElement::qmlCode
QString qmlCode() const
The QML code that will be represented within this widget.
Definition
qgsattributeeditorqmlelement.cpp:28
QgsAttributeEditorQmlElement::setQmlCode
void setQmlCode(const QString &qmlCode)
Sets the QML code that will be represented within this widget to qmlCode.
Definition
qgsattributeeditorqmlelement.cpp:33
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
qgsattributeeditorqmlelement.h
Generated on Sun Dec 15 2024 01:32:01 for QGIS API Documentation by
1.9.8