16#ifndef QGSLEGENDSETTINGS_H
17#define QGSLEGENDSETTINGS_H
56 void setTitle(
const QString &t ) { mTitle = t; }
63 QString
title()
const {
return mTitle; }
231 Q_DECL_DEPRECATED
void setLayerFontColor( const QColor &fontColor )
SIP_DEPRECATED;
404 Q_DECL_DEPRECATED
void setLineSpacing(
double s );
414 Q_DECL_DEPRECATED
void setMmPerMapUnit(
double mmPerMapUnit )
SIP_DEPRECATED;
424 Q_DECL_DEPRECATED
void setUseAdvancedEffects(
bool use )
SIP_DEPRECATED;
440 Q_DECL_DEPRECATED
void setMapScale(
double scale )
SIP_DEPRECATED;
454 Q_DECL_DEPRECATED
void setMapUnitsPerPixel(
double mapUnitsPerPixel )
SIP_DEPRECATED;
487 QStringList splitStringForWrapping( const QString &stringToSplt ) const;
493 void drawText( QPainter *p,
double x,
double y, const QString &text, const QFont &font ) const;
505 void drawText( QPainter *p, const QRectF &rect, const QString &text, const QFont &font, Qt::AlignmentFlag halignment = Qt::AlignLeft, Qt::AlignmentFlag valignment = Qt::AlignTop,
int flags = Qt::TextWordWrap ) const;
508 QFont scaledFontPixelSize( const QFont &font ) const;
511 double pixelFontSize(
double pointSize ) const;
514 double textWidthMillimeters( const QFont &font, const QString &text ) const;
517 double fontHeightCharacterMM( const QFont &font, QChar
c ) const;
520 double fontAscentMillimeters( const QFont &font ) const;
523 double fontDescentMillimeters( const QFont &font ) const;
529 Qgis::LegendJsonRenderFlags jsonRenderFlags() const;
535 void setJsonRenderFlags( const
Qgis::LegendJsonRenderFlags &jsonRenderFlags );
566 Qt::AlignmentFlag mTitleAlignment = Qt::AlignLeft;
570 double mAutoWrapLinesAfter = 0;
579 double mMaxSymbolSize = 0.0;
582 double mMinSymbolSize = 0.0;
585 QSizeF mWmsLegendSize;
588 bool mSynchronousLegendRequests =
false;
591 double mLineSpacing = 1;
594 double mColumnSpace = 2;
597 int mColumnCount = 1;
600 bool mSplitLayer =
false;
603 bool mEqualColumnWidth =
false;
605 bool mRasterSymbolStroke =
true;
606 QColor mRasterStrokeColor;
607 double mRasterStrokeWidth = 0.0;
609 QVector<QgsLegendStyle> mStyleMap;
612 double mMmPerMapUnit = 1;
615 bool mUseAdvancedEffects =
true;
618 double mMapScale = 1;
624 Qt::AlignmentFlag mSymbolAlignment = Qt::AlignLeft;
Provides global constants and enumerations for use throughout the application.
LegendComponent
Component of legends which can be styled.
QFlags< LegendJsonRenderFlag > LegendJsonRenderFlags
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
int columnCount() const
Returns the desired minimum number of columns to show in the legend.
void setSymbolAlignment(Qt::AlignmentFlag alignment)
Sets the alignment for placement of legend symbols.
QString wrapChar() const
Returns the string used as a wrapping character.
void setWrapChar(const QString &t)
Sets a string to use as a wrapping character.
void setRasterStrokeColor(const QColor &color)
Sets the stroke color for the stroke drawn around raster symbol items.
void setColumnSpace(double s)
Sets the margin space between adjacent columns (in millimeters).
QgsLegendStyle & rstyle(Qgis::LegendComponent s)
Returns modifiable reference to the style for a legend component.
void setTitle(const QString &t)
Sets the title for the legend, which will be rendered above all legend items.
bool drawRasterStroke() const
Returns whether a stroke will be drawn around raster symbol items.
void setDrawRasterStroke(bool enabled)
Sets whether a stroke will be drawn around raster symbol items.
QSizeF wmsLegendSize() const
Returns the size (in millimeters) of WMS legend graphics shown in the legend.
double minimumSymbolSize() const
Returns the minimum symbol size (in mm).
double autoWrapLinesAfter() const
Returns the maximum line length (in millimeters) allowed before lines of text in the legend will be a...
double rasterStrokeWidth() const
Returns the stroke width (in millimeters) for the stroke drawn around raster symbol items.
void setColumnCount(int c)
Sets the desired minimum number of columns to show in the legend.
void setTitleAlignment(Qt::AlignmentFlag alignment)
Sets the alignment of the legend title.
void setStyle(Qgis::LegendComponent s, const QgsLegendStyle &style)
Sets the style for a legend component.
void setAutoWrapLinesAfter(double length)
Sets the maximum line length (in millimeters) allowed before lines of text in the legend will be auto...
Qt::AlignmentFlag titleAlignment() const
Returns the alignment of the legend title.
QSizeF symbolSize() const
Returns the default symbol size (in millimeters) used for legend items.
double maximumSymbolSize() const
Returns the maximum symbol size (in mm).
QString title() const
Returns the title for the legend, which will be rendered above all legend items.
QColor rasterStrokeColor() const
Returns the stroke color for the stroke drawn around raster symbol items.
Q_DECL_DEPRECATED double lineSpacing() const
Returns the line spacing to use between lines of legend text.
void setSplitLayer(bool s)
Sets whether layer components can be split over multiple columns.
double columnSpace() const
Returns the margin space between adjacent columns (in millimeters).
void updateDataDefinedProperties(QgsRenderContext &context)
Updates any data-defined properties in the settings, using the specified render context.
QgsLegendStyle style(Qgis::LegendComponent s) const
Returns the style for a legend component.
void setEqualColumnWidth(bool s)
Sets whether all columns should have equal widths.
void setBoxSpace(double s)
Sets the legend box space (in millimeters), which is the empty margin around the inside of the legend...
void setSynchronousLegendRequests(bool b)
Sets whether to request legend graphics synchronously.
bool synchronousLegendRequests() const
Returns whether to request legend graphics synchronously.
double boxSpace() const
Returns the legend box space (in millimeters), which is the empty margin around the inside of the leg...
void setMaximumSymbolSize(double size)
Set the maximum symbol size for symbol (in millimeters).
bool splitLayer() const
Returns true if layer components can be split over multiple columns.
void setMinimumSymbolSize(double size)
Set the minimum symbol size for symbol (in millimeters).
void setRasterStrokeWidth(double width)
Sets the stroke width for the stroke drawn around raster symbol items.
Qt::AlignmentFlag symbolAlignment() const
Returns the alignment for placement of legend symbols.
bool equalColumnWidth() const
Returns true if all columns should have equal widths.
void setSymbolSize(QSizeF s)
Sets the default symbol size (in millimeters) used for legend items.
void setWmsLegendSize(QSizeF s)
Sets the desired size (in millimeters) of WMS legend graphics shown in the legend.
Contains detailed styling information relating to how a layout legend should be rendered.
Contains information about the context of a rendering operation.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c