QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
16 #ifndef QGSDATADEFINEDSIZELEGEND_H
17 #define QGSDATADEFINEDSIZELEGEND_H
73 SizeClass(
double size,
const QString &label ): size( size ), label( label ) {}
112 void setClasses(
const QList< QgsDataDefinedSizeLegend::SizeClass > &classes ) { mSizeClasses = classes; }
114 QList< QgsDataDefinedSizeLegend::SizeClass >
classes()
const {
return mSizeClasses; }
117 void setTitle(
const QString &title ) { mTitleLabel = title; }
119 QString
title()
const {
return mTitleLabel; }
127 void setFont(
const QFont &font ) { mFont = font; }
129 QFont
font()
const {
return mFont; }
157 QImage collapsedLegendImage(
QgsRenderContext &context,
const QColor &backgroundColor = Qt::transparent,
double paddingMM = 1 )
const;
166 LegendType mType = LegendSeparated;
168 QList< SizeClass > mSizeClasses;
169 std::unique_ptr<QgsMarkerSymbol> mSymbol;
170 std::unique_ptr<QgsLineSymbol> mLineSymbol;
171 std::unique_ptr<QgsSizeScaleTransformer> mSizeScaleTransformer;
172 VerticalAlignment mVAlign = AlignBottom;
174 QColor mTextColor = Qt::black;
175 Qt::AlignmentFlag mTextAlignment = Qt::AlignLeft;
178 #endif // QGSDATADEFINEDSIZELEGEND_H
double size
Marker size in units used by the symbol (usually millimeters). May be further scaled before rendering...
Qt::AlignmentFlag textAlignment() const
Returns horizontal text alignment for rendering of labels - only valid for collapsed legend.
A store for object properties.
LegendType
Determines how to display data-defined size legend.
@ AlignBottom
Symbols are aligned to the bottom.
QString title() const
Returns title label for data-defined size legend.
void setClasses(const QList< QgsDataDefinedSizeLegend::SizeClass > &classes)
Sets list of classes: each class is a pair of symbol size (in units used by the symbol) and label.
@ AlignCenter
Symbols are aligned to the center.
Definition of one class for the legend.
@ LegendCollapsed
All classes are rendered within one legend node.
@ LegendSeparated
Each class (size value) has a separate legend node.
void setTextColor(const QColor &color)
Sets text color for rendering of labels - only valid for collapsed legend.
QColor textColor() const
Returns text color for rendering of labels - only valid for collapsed legend.
void setVerticalAlignment(VerticalAlignment vAlign)
Sets vertical alignment of symbols - only valid for collapsed legend.
void setTitle(const QString &title)
Sets title label for data-defined size legend.
VerticalAlignment
How to vertically align symbols when all classes go into one node.
QFont font() const
Returns font used for rendering of labels - only valid for collapsed legend.
QList< QgsDataDefinedSizeLegend::SizeClass > classes() const
Returns list of classes: each class is a pair of symbol size (in units used by the symbol) and label.
SizeClass(double size, const QString &label)
void setLegendType(LegendType type)
Sets how the legend should be rendered.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QString label
Label to be shown with the particular symbol size.
void setTextAlignment(Qt::AlignmentFlag flag)
Sets horizontal text alignment for rendering of labels - only valid for collapsed legend.
VerticalAlignment verticalAlignment() const
Returns vertical alignment of symbols - only valid for collapsed legend.
LegendType legendType() const
Returns how the legend should be rendered.
void setFont(const QFont &font)
Sets font used for rendering of labels - only valid for collapsed legend.