QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
vector
qgsvectorlayerselectionproperties.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvectorlayerselectionproperties.h
3
---------------
4
begin : July 2023
5
copyright : (C) 2023 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
19
#ifndef QGSVECTORLAYERSELECTIONPROPERTIES_H
20
#define QGSVECTORLAYERSELECTIONPROPERTIES_H
21
22
#include "
qgis.h
"
23
#include "qgis_core.h"
24
#include "
qgis_sip.h
"
25
#include "
qgsmaplayerselectionproperties.h
"
26
27
#include <QColor>
28
29
class
QgsSymbol
;
30
38
class
CORE_EXPORT
QgsVectorLayerSelectionProperties
:
public
QgsMapLayerSelectionProperties
39
{
40
Q_OBJECT
41
Q_PROPERTY(
Qgis::SelectionRenderingMode
selectionRenderingMode
READ
selectionRenderingMode
WRITE
setSelectionRenderingMode
NOTIFY
selectionRenderingModeChanged
)
42
Q_PROPERTY( QColor
selectionColor
READ
selectionColor
WRITE
setSelectionColor
NOTIFY
selectionColorChanged
)
43
44
public:
48
QgsVectorLayerSelectionProperties
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
49
~
QgsVectorLayerSelectionProperties
() override;
50
51
QDomElement
writeXml
( QDomElement &element, QDomDocument &doc, const
QgsReadWriteContext
&context ) override;
52
bool
readXml
( const QDomElement &element, const
QgsReadWriteContext
&context ) override;
53
QgsVectorLayerSelectionProperties
*
clone
() const override
SIP_FACTORY
;
54
60
Qgis
::SelectionRenderingMode
selectionRenderingMode
() const;
61
67
void
setSelectionRenderingMode
(
Qgis
::SelectionRenderingMode mode );
68
77
QColor
selectionColor
() const;
78
87
void
setSelectionColor
( const QColor &color );
88
96
QgsSymbol
*
selectionSymbol
() const;
97
106
void
setSelectionSymbol
(
QgsSymbol
*symbol
SIP_TRANSFER
);
107
108
signals:
109
114
void
selectionRenderingModeChanged
();
115
120
void
selectionColorChanged
();
121
126
void
selectionSymbolChanged
();
127
128
private:
129
Qgis
::SelectionRenderingMode mSelectionRenderingMode =
Qgis
::SelectionRenderingMode::Default;
130
QColor mSelectionColor;
131
std::unique_ptr<
QgsSymbol
> mSelectionSymbol;
132
};
133
134
#endif
// QGSVECTORLAYERSELECTIONPROPERTIES_H
Qgis
Provides global constants and enumerations for use throughout the application.
Definition
qgis.h:62
Qgis::SelectionRenderingMode
SelectionRenderingMode
Specifies how a selection should be rendered.
Definition
qgis.h:1928
QgsMapLayerSelectionProperties::QgsMapLayerSelectionProperties
QgsMapLayerSelectionProperties(QObject *parent)
Constructor for QgsMapLayerSelectionProperties, with the specified parent object.
Definition
qgsmaplayerselectionproperties.cpp:22
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsSymbol
Abstract base class for all rendered symbols.
Definition
qgssymbol.h:227
QgsVectorLayerSelectionProperties::setSelectionSymbol
void setSelectionSymbol(QgsSymbol *symbol)
Sets the symbol used to render selected features in the layer.
Definition
qgsvectorlayerselectionproperties.cpp:101
QgsVectorLayerSelectionProperties::QgsVectorLayerSelectionProperties
QgsVectorLayerSelectionProperties(QObject *parent=nullptr)
Constructor for QgsVectorLayerSelectionProperties, with the specified parent object.
Definition
qgsvectorlayerselectionproperties.cpp:29
QgsVectorLayerSelectionProperties::selectionColor
QColor selectionColor
Definition
qgsvectorlayerselectionproperties.h:42
QgsVectorLayerSelectionProperties::selectionRenderingMode
Qgis::SelectionRenderingMode selectionRenderingMode
Definition
qgsvectorlayerselectionproperties.h:41
QgsVectorLayerSelectionProperties::selectionSymbol
QgsSymbol * selectionSymbol() const
Returns the symbol used to render selected features in the layer.
Definition
qgsvectorlayerselectionproperties.cpp:96
QgsVectorLayerSelectionProperties::selectionSymbolChanged
void selectionSymbolChanged()
Emitted whenever the selection symbol changes.
QgsVectorLayerSelectionProperties::clone
QgsVectorLayerSelectionProperties * clone() const override
Creates a clone of the properties.
Definition
qgsvectorlayerselectionproperties.cpp:71
QgsVectorLayerSelectionProperties::writeXml
QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) override
Writes the properties to a DOM element, to be used later with readXml().
Definition
qgsvectorlayerselectionproperties.cpp:36
QgsVectorLayerSelectionProperties::readXml
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads temporal properties from a DOM element previously written by writeXml().
Definition
qgsvectorlayerselectionproperties.cpp:55
QgsVectorLayerSelectionProperties::setSelectionColor
void setSelectionColor(const QColor &color)
Sets the color to use for rendering selected features in the layer.
Definition
qgsvectorlayerselectionproperties.cpp:85
QgsVectorLayerSelectionProperties::selectionColorChanged
void selectionColorChanged()
Emitted whenever the selection color changes.
QgsVectorLayerSelectionProperties::setSelectionRenderingMode
void setSelectionRenderingMode(Qgis::SelectionRenderingMode mode)
Sets the selection rendering mode to use for selected features in the layer.
Definition
qgsvectorlayerselectionproperties.cpp:112
QgsVectorLayerSelectionProperties::selectionRenderingModeChanged
void selectionRenderingModeChanged()
Emitted whenever the selection rendering mode changes.
qgis.h
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsmaplayerselectionproperties.h
Generated on
for QGIS API Documentation by
1.17.0