QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
editform
qgsattributeeditorcontainer.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsattributeeditorcontainer.h - QgsAttributeEditorElement
3
4
---------------------
5
begin : 12.01.2021
6
copyright : (C) 2021 by Denis Rouzaud
7
email : denis@opengis.ch
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
#ifndef QGSATTRIBUTEEDITORCONTAINER_H
17
#define QGSATTRIBUTEEDITORCONTAINER_H
18
19
#include "qgis_core.h"
20
#include "
qgsattributeeditorelement.h
"
21
#include "
qgsoptionalexpression.h
"
22
28
class
CORE_EXPORT
QgsAttributeEditorContainer
:
public
QgsAttributeEditorElement
29
{
30
public
:
38
QgsAttributeEditorContainer
(
const
QString &
name
,
QgsAttributeEditorElement
*
parent
,
const
QColor &
backgroundColor
= QColor() )
39
:
QgsAttributeEditorElement
(
Qgis
::AttributeEditorType::Container,
name
,
parent
)
40
, mBackgroundColor(
backgroundColor
)
41
{}
42
43
~QgsAttributeEditorContainer
()
override
;
44
50
virtual
void
addChildElement(
QgsAttributeEditorElement
*element
SIP_TRANSFER
);
51
58
void
setType
(
Qgis::AttributeEditorContainerType
type
) { mType =
type
; }
59
66
Qgis::AttributeEditorContainerType
type
()
const
{
return
mType; }
67
74
Q_DECL_DEPRECATED
virtual
void
setIsGroupBox(
bool
isGroupBox )
SIP_DEPRECATED
;
75
83
Q_DECL_DEPRECATED
virtual
bool
isGroupBox() const
SIP_DEPRECATED
;
84
93
bool
collapsed
()
const
{
return
mCollapsed; };
94
102
void
setCollapsed
(
bool
collapsed
) { mCollapsed =
collapsed
; };
103
109
QList<QgsAttributeEditorElement *>
children
()
const
{
return
mChildren; }
110
118
virtual
QList<QgsAttributeEditorElement *> findElements(
Qgis::AttributeEditorType
type )
const
;
119
123
void
clear();
124
128
void
setName(
const
QString &name );
129
135
int
columnCount()
const
;
136
142
void
setColumnCount(
int
columnCount );
143
148
QgsAttributeEditorElement
*
clone
(
QgsAttributeEditorElement
*parent )
const
override
SIP_FACTORY
;
149
156
QgsOptionalExpression
visibilityExpression()
const
;
157
164
void
setVisibilityExpression(
const
QgsOptionalExpression
&visibilityExpression );
165
176
QgsOptionalExpression
collapsedExpression() const
SIP_SKIP
;
177
188
void
setCollapsedExpression( const
QgsOptionalExpression
&collapsedExpression )
SIP_SKIP
;
189
196
QColor backgroundColor() const;
197
203
void
setBackgroundColor( const QColor &backgroundColor );
204
205
private:
206
void
saveConfiguration( QDomElement &elem, QDomDocument &doc ) const override;
207
void
loadConfiguration( const QDomElement &element, const QString &layerId, const
QgsReadWriteContext
&context, const
QgsFields
&fields ) override;
208
QString typeIdentifier() const override;
209
210
Qgis
::AttributeEditorContainerType mType =
Qgis
::AttributeEditorContainerType::GroupBox;
211
QList<
QgsAttributeEditorElement
*> mChildren;
212
int
mColumnCount = 1;
213
QgsOptionalExpression
mVisibilityExpression;
214
QColor mBackgroundColor;
215
bool
mCollapsed = false;
216
QgsOptionalExpression
mCollapsedExpression;
217
};
218
219
220
#endif
// QGSATTRIBUTEEDITORCONTAINER_H
Qgis
Provides global constants and enumerations for use throughout the application.
Definition
qgis.h:62
Qgis::AttributeEditorContainerType
AttributeEditorContainerType
Attribute editor container types.
Definition
qgis.h:6290
Qgis::AttributeEditorType
AttributeEditorType
Attribute editor types.
Definition
qgis.h:6271
QgsAttributeEditorContainer
A container for attribute editors, used to group them visually in the attribute form if it is set to ...
Definition
qgsattributeeditorcontainer.h:29
QgsAttributeEditorContainer::QgsAttributeEditorContainer
QgsAttributeEditorContainer(const QString &name, QgsAttributeEditorElement *parent, const QColor &backgroundColor=QColor())
Creates a new attribute editor container.
Definition
qgsattributeeditorcontainer.h:38
QgsAttributeEditorContainer::collapsed
bool collapsed() const
For group box containers returns true if this group box is collapsed.
Definition
qgsattributeeditorcontainer.h:93
QgsAttributeEditorContainer::type
Qgis::AttributeEditorContainerType type() const
Returns the container type.
Definition
qgsattributeeditorcontainer.h:66
QgsAttributeEditorContainer::setType
void setType(Qgis::AttributeEditorContainerType type)
Sets the container type.
Definition
qgsattributeeditorcontainer.h:58
QgsAttributeEditorContainer::children
QList< QgsAttributeEditorElement * > children() const
Gets a list of the children elements of this container.
Definition
qgsattributeeditorcontainer.h:109
QgsAttributeEditorContainer::backgroundColor
QColor backgroundColor() const
Returns the background color of the container.
Definition
qgsattributeeditorcontainer.cpp:77
QgsAttributeEditorContainer::setCollapsed
void setCollapsed(bool collapsed)
For group box containers sets if this group box is collapsed.
Definition
qgsattributeeditorcontainer.h:102
QgsAttributeEditorElement
An abstract base class for any elements of a drag and drop form.
Definition
qgsattributeeditorelement.h:44
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
QgsAttributeEditorElement::clone
virtual QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const =0
Returns a clone of this element.
QgsFields
Container of fields for a vector layer.
Definition
qgsfields.h:45
QgsOptionalExpression
An expression with an additional enabled flag.
Definition
qgsoptionalexpression.h:36
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition
qgis_sip.h:113
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsattributeeditorelement.h
qgsoptionalexpression.h
Generated on
for QGIS API Documentation by
1.17.0