QGIS API Documentation
4.3.0-Master (4ecdf0f3f59)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
symbology
qgsselectivemaskingsource.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsselectivemaskingsource.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 QGSSELECTIVEMASKINGSOURCE_H
17
#define QGSSELECTIVEMASKINGSOURCE_H
18
19
#include "
qgis.h
"
20
#include "qgis_core.h"
21
#include "
qgis_sip.h
"
22
23
#include <QString>
24
25
using namespace
Qt::StringLiterals;
26
35
class
CORE_EXPORT
QgsSelectiveMaskSource
36
{
37
public
:
41
QgsSelectiveMaskSource
() =
default
;
42
50
QgsSelectiveMaskSource
(
const
QString &
layerId
,
Qgis::SelectiveMaskSourceType
sourceType
,
const
QString &
sourceId
= QString() );
51
55
bool
isValid
()
const
{
return
!mLayerId.isEmpty(); }
56
62
QString
layerId
()
const
{
return
mLayerId; }
63
69
void
setLayerId
(
const
QString &
id
) { mLayerId = id; }
70
76
Qgis::SelectiveMaskSourceType
sourceType
()
const
{
return
mSourceType; }
77
83
void
setSourceType
(
Qgis::SelectiveMaskSourceType
type ) { mSourceType = type; }
84
90
QString
sourceId
()
const
{
return
mSourceId; }
91
97
void
setSourceId
(
const
QString &
id
) { mSourceId = id; }
98
99
#ifdef SIP_RUN
100
// clang-format off
101
SIP_PYOBJECT __repr__();
102
% MethodCode
103
if
( !sipCpp->isValid() )
104
{
105
sipRes = PyUnicode_FromString(
"<QgsSelectiveMaskSource: invalid>"
);
106
}
107
else
if
( sipCpp->sourceId().isEmpty() )
108
{
109
const
QString str = u
"<QgsSelectiveMaskSource: %1 (%2)>"
_s.arg(
110
sipCpp->layerId(),
111
qgsEnumValueToKey
( sipCpp->sourceType() ) );
112
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
113
}
114
else
115
{
116
const
QString str = u
"<QgsSelectiveMaskSource: %1 - %2 (%3)>"
_s.arg(
117
sipCpp->layerId(),
118
sipCpp->sourceId(),
119
qgsEnumValueToKey
( sipCpp->sourceType() ) );
120
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
121
}
122
% End
123
// clang-format on
124
#endif
125
126
bool
operator==
(
const
QgsSelectiveMaskSource
&other )
const
127
=
default
;
128
bool
operator!=
(
const
QgsSelectiveMaskSource
&other )
const
=
default
;
129
130
private
:
131
QString mLayerId;
132
Qgis::SelectiveMaskSourceType
mSourceType =
Qgis::SelectiveMaskSourceType::SymbolLayer
;
133
QString mSourceId;
134
};
135
136
#endif
//QGSSELECTIVEMASKINGSOURCE_H
Qgis::SelectiveMaskSourceType
SelectiveMaskSourceType
Selective masking source types.
Definition
qgis.h:3292
Qgis::SelectiveMaskSourceType::SymbolLayer
@ SymbolLayer
A mask generated from a symbol layer.
Definition
qgis.h:3293
QgsSelectiveMaskSource::layerId
QString layerId() const
Returns the source layer id.
Definition
qgsselectivemaskingsource.h:62
QgsSelectiveMaskSource::QgsSelectiveMaskSource
QgsSelectiveMaskSource()=default
Constructor for an invalid QgsSelectiveMaskSource.
QgsSelectiveMaskSource::setSourceId
void setSourceId(const QString &id)
Sets the symbol layer or label rule id.
Definition
qgsselectivemaskingsource.h:97
QgsSelectiveMaskSource::setLayerId
void setLayerId(const QString &id)
Sets the source layer id.
Definition
qgsselectivemaskingsource.h:69
QgsSelectiveMaskSource::isValid
bool isValid() const
Returns true if the source is valid (i.e.
Definition
qgsselectivemaskingsource.h:55
QgsSelectiveMaskSource::operator!=
bool operator!=(const QgsSelectiveMaskSource &other) const =default
QgsSelectiveMaskSource::sourceType
Qgis::SelectiveMaskSourceType sourceType() const
Returns the type of masking source.
Definition
qgsselectivemaskingsource.h:76
QgsSelectiveMaskSource::setSourceType
void setSourceType(Qgis::SelectiveMaskSourceType type)
Sets the source type.
Definition
qgsselectivemaskingsource.h:83
QgsSelectiveMaskSource::sourceId
QString sourceId() const
Returns the symbol layer or label rule ID.
Definition
qgsselectivemaskingsource.h:90
QgsSelectiveMaskSource::operator==
bool operator==(const QgsSelectiveMaskSource &other) const =default
qgis.h
qgsEnumValueToKey
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition
qgis.h:8045
qgis_sip.h
Generated on
for QGIS API Documentation by
1.17.0