QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
symbology
qgsselectivemaskingsourceset.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsselectivemaskingsourceset.h
3
---------------------------
4
begin : January 2026
5
copyright : (C) 2026 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSSELECTIVEMASKINGSOURCESET_H
17
#define QGSSELECTIVEMASKINGSOURCESET_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsselectivemaskingsource.h
"
22
23
#include <QString>
24
25
using namespace
Qt::StringLiterals;
26
27
class
QDomElement;
28
class
QDomDocument;
29
class
QgsReadWriteContext
;
30
39
class
CORE_EXPORT
QgsSelectiveMaskingSourceSet
40
{
41
public
:
45
QgsSelectiveMaskingSourceSet
();
46
50
bool
isValid
()
const
{
return
mIsValid; }
51
60
void
setId
(
const
QString &
id
) { mId =
id
; }
61
70
QString
id
()
const
{
return
mId; }
71
77
QString
name
()
const
{
return
mName; }
78
84
void
setName
(
const
QString &
name
)
85
{
86
mName =
name
;
87
mIsValid =
true
;
88
}
89
95
QVector< QgsSelectiveMaskSource > sources()
const
;
96
102
void
setSources(
const
QVector< QgsSelectiveMaskSource > &sources );
103
107
void
append(
const
QgsSelectiveMaskSource
&source );
108
114
QDomElement writeXml( QDomDocument &document,
const
QgsReadWriteContext
&context )
const
;
115
121
bool
readXml(
const
QDomElement &element,
const
QDomDocument &document,
const
QgsReadWriteContext
&context );
122
126
QgsSelectiveMaskSource
&operator[](
int
index )
SIP_FACTORY
;
127
#ifdef SIP_RUN
128
// clang-format off
129
% MethodCode
130
SIP_SSIZE_T idx = sipConvertFromSequenceIndex( a0, sipCpp->size() );
131
if
( idx < 0 )
132
sipIsErr = 1;
133
else
134
sipRes =
new
QgsSelectiveMaskSource
( sipCpp->operator[]( idx ) );
135
% End
136
// clang-format on
137
#endif
138
142
int
size()
const
;
143
147
bool
isEmpty()
const
;
148
149
#ifdef SIP_RUN
150
// clang-format off
151
int
__len__()
const
;
152
% MethodCode
153
sipRes = sipCpp->size();
154
% End
155
// clang-format on
156
#endif
157
158
#ifdef SIP_RUN
159
// clang-format off
160
SIP_PYOBJECT __repr__();
161
% MethodCode
162
if
( !sipCpp->isValid() )
163
{
164
sipRes = PyUnicode_FromString(
"<QgsSelectiveMaskingSourceSet: invalid>"
);
165
}
166
else
if
( !sipCpp->name().isEmpty() )
167
{
168
const
QString str = u
"<QgsSelectiveMaskingSourceSet: %1 (%2)>"
_s.arg(
169
sipCpp->id(),
170
sipCpp->name() );
171
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
172
}
173
else
174
{
175
const
QString str = u
"<QgsSelectiveMaskingSourceSet: %1>"
_s.arg(
176
sipCpp->id() );
177
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
178
}
179
% End
180
// clang-format on
181
#endif
182
183
// clang-format off
184
private
:
185
// clang-format on
186
bool
mIsValid
187
=
false
;
188
QString mId;
189
QString mName;
190
QVector< QgsSelectiveMaskSource > mSources;
191
};
192
193
Q_DECLARE_METATYPE
(
QgsSelectiveMaskingSourceSet
)
194
195
#endif
//QGSSELECTIVEMASKINGSOURCESET_H
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsSelectiveMaskSource
Encapsulates a single source for selective masking (e.g.
Definition
qgsselectivemaskingsource.h:36
QgsSelectiveMaskingSourceSet
Represents a named set of selective masking sources (QgsSelectiveMaskSource).
Definition
qgsselectivemaskingsourceset.h:40
QgsSelectiveMaskingSourceSet::setName
void setName(const QString &name)
Sets the set's unique name.
Definition
qgsselectivemaskingsourceset.h:84
QgsSelectiveMaskingSourceSet::id
QString id() const
Returns a unique identifier for the set.
Definition
qgsselectivemaskingsourceset.h:70
QgsSelectiveMaskingSourceSet::QgsSelectiveMaskingSourceSet
QgsSelectiveMaskingSourceSet()
Constructor for an empty (invalid) QgsSelectiveMaskingSourceSet.
Definition
qgsselectivemaskingsourceset.cpp:28
QgsSelectiveMaskingSourceSet::setId
void setId(const QString &id)
Sets the unique identifier for the set.
Definition
qgsselectivemaskingsourceset.h:60
QgsSelectiveMaskingSourceSet::name
QString name() const
Returns the set's unique name.
Definition
qgsselectivemaskingsourceset.h:77
QgsSelectiveMaskingSourceSet::isValid
bool isValid() const
Returns true if the source set is valid, or false if it is invalid (default constructed).
Definition
qgsselectivemaskingsourceset.h:50
qgis_sip.h
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
qgsselectivemaskingsource.h
Generated on
for QGIS API Documentation by
1.17.0