QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
qgscolorramplegendnodesettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscolorramplegendnode.h
3 --------------------------------------
4 Date : December 2020
5 Copyright : (C) 2020 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 QGSCOLORRAMPLEGENDNODESETTINGS_H
17#define QGSCOLORRAMPLEGENDNODESETTINGS_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
21
22#include "qgstextformat.h"
23#include <QString>
24#include <memory>
25
28class QDomDocument;
29class QDomElement;
30
38{
39 public:
40
49
51
53
55
57
65
72 void setDirection( QgsColorRampLegendNodeSettings::Direction direction );
73
82 QString minimumLabel() const;
83
92 void setMinimumLabel( const QString &label );
93
102 QString maximumLabel() const;
103
112 void setMaximumLabel( const QString &label );
113
120 const QgsNumericFormat *numericFormat() const;
121
130 void setNumericFormat( QgsNumericFormat *format SIP_TRANSFER );
131
135 void writeXml( QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context ) const;
136
140 void readXml( const QDomElement &element, const QgsReadWriteContext &context );
141
148 QString prefix() const;
149
156 void setPrefix( const QString &prefix );
157
164 QString suffix() const;
165
172 void setSuffix( const QString &suffix );
173
179 QgsTextFormat textFormat() const;
180
186 void setTextFormat( const QgsTextFormat &format );
187
194 Qt::Orientation orientation() const;
195
202 void setOrientation( Qt::Orientation orientation );
203
209 bool useContinuousLegend() const;
210
221 void setUseContinuousLegend( bool useContinuousLegend );
222
223 private:
224 bool mUseContinuousLegend = true;
225 QString mMinimumLabel;
226 QString mMaximumLabel;
227 QString mPrefix;
228 QString mSuffix;
229 Direction mDirection = MinimumToMaximum;
230 std::unique_ptr< QgsNumericFormat > mNumericFormat;
231 QgsTextFormat mTextFormat;
232 Qt::Orientation mOrientation = Qt::Vertical;
233};
234
235#endif // QGSCOLORRAMPLEGENDNODESETTINGS_H
Settings for a color ramp legend node.
@ MaximumToMinimum
Maximum value on bottom, minimum value on top.
@ MinimumToMaximum
Minimum value on bottom, maximum value on top.
A numeric formatter allows for formatting a numeric value for display, using a variety of different f...
The class is used as a container of context for various read/write operations on other objects.
Container for all settings relating to text rendering.
#define SIP_TRANSFER
Definition qgis_sip.h:36