QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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"
26
27#include <QColor>
28
29class QgsSymbol;
30
39{
40 Q_OBJECT
43
44 public:
45
49 QgsVectorLayerSelectionProperties( QObject *parent SIP_TRANSFERTHIS = nullptr );
51
52 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
53 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
55
61 Qgis::SelectionRenderingMode selectionRenderingMode() const;
62
68 void setSelectionRenderingMode( Qgis::SelectionRenderingMode mode );
69
78 QColor selectionColor() const;
79
88 void setSelectionColor( const QColor &color );
89
98
108
109 signals:
110
116
122
128
129 private:
130
131 Qgis::SelectionRenderingMode mSelectionRenderingMode = Qgis::SelectionRenderingMode::Default;
132 QColor mSelectionColor;
133 std::unique_ptr< QgsSymbol > mSelectionSymbol;
134};
135
136#endif // QGSVECTORLAYERSELECTIONPROPERTIES_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
SelectionRenderingMode
Specifies how a selection should be rendered.
Definition qgis.h:1758
QgsMapLayerSelectionProperties(QObject *parent)
Constructor for QgsMapLayerSelectionProperties, with the specified parent object.
A container for the context for various read/write operations on objects.
Abstract base class for all rendered symbols.
Definition qgssymbol.h:231
void setSelectionSymbol(QgsSymbol *symbol)
Sets the symbol used to render selected features in the layer.
QgsVectorLayerSelectionProperties(QObject *parent=nullptr)
Constructor for QgsVectorLayerSelectionProperties, with the specified parent object.
QgsSymbol * selectionSymbol() const
Returns the symbol used to render selected features in the layer.
void selectionSymbolChanged()
Emitted whenever the selection symbol changes.
QgsVectorLayerSelectionProperties * clone() const override
Creates a clone of the properties.
QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) override
Writes the properties to a DOM element, to be used later with readXml().
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads temporal properties from a DOM element previously written by writeXml().
void setSelectionColor(const QColor &color)
Sets the color to use for rendering selected features in the layer.
void selectionColorChanged()
Emitted whenever the selection color changes.
void setSelectionRenderingMode(Qgis::SelectionRenderingMode mode)
Sets the selection rendering mode to use for selected features in the layer.
void selectionRenderingModeChanged()
Emitted whenever the selection rendering mode changes.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84