16 #ifndef QGSLEGENDSETTINGS_H 17 #define QGSLEGENDSETTINGS_H 19 #include "qgis_core.h" 43 void setTitle(
const QString &t ) { mTitle = t; }
44 QString
title()
const {
return mTitle; }
95 QColor
layerFontColor()
const {
return mLayerFontColor.isValid() ? mLayerFontColor : fontColor() ;}
222 double mapUnitsPerPixel()
const;
229 void setMapUnitsPerPixel(
double mapUnitsPerPixel );
231 int dpi()
const {
return mDpi; }
255 QStringList splitStringForWrapping(
const QString &stringToSplt )
const;
261 void drawText( QPainter *p,
double x,
double y,
const QString &text,
const QFont &font )
const;
273 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;
276 QFont scaledFontPixelSize(
const QFont &font )
const;
279 double pixelFontSize(
double pointSize )
const;
282 double textWidthMillimeters(
const QFont &font,
const QString &text )
const;
285 double fontHeightCharacterMM(
const QFont &font, QChar
c )
const;
288 double fontAscentMillimeters(
const QFont &font )
const;
291 double fontDescentMillimeters(
const QFont &font )
const;
298 Qt::AlignmentFlag mTitleAlignment = Qt::AlignLeft;
311 QSizeF mWmsLegendSize;
314 double mLineSpacing = 1;
317 double mColumnSpace = 2;
320 int mColumnCount = 1;
323 bool mSplitLayer =
false;
326 bool mEqualColumnWidth =
false;
328 bool mRasterSymbolStroke =
true;
329 QColor mRasterStrokeColor;
330 double mRasterStrokeWidth = 0.0;
332 QMap<QgsLegendStyle::Style, QgsLegendStyle> mStyleMap;
335 double mMmPerMapUnit = 1;
338 bool mUseAdvancedEffects =
true;
341 double mMapScale = 1;
347 QColor mLayerFontColor;
350 Qt::AlignmentFlag mSymbolAlignment = Qt::AlignLeft;
355 #endif // QGSLEGENDSETTINGS_H void setTitleAlignment(Qt::AlignmentFlag alignment)
Sets the alignment of the legend title.
void setWrapChar(const QString &t)
void setEqualColumnWidth(bool s)
double mapScale() const
Returns the legend map scale.
void setBoxSpace(double s)
void setMmPerMapUnit(double mmPerMapUnit)
bool useAdvancedEffects() const
void setSymbolAlignment(Qt::AlignmentFlag alignment)
Sets the alignment for placement of legend symbols.
void setSymbolSize(QSizeF s)
Qt::AlignmentFlag symbolAlignment() const
Returns the alignment for placement of legend symbols.
QColor layerFontColor() const
Returns layer font color, defaults to fontColor()
Contains detailed styling information relating to how a layout legend should be rendered.
bool drawRasterStroke() const
Returns whether a stroke will be drawn around raster symbol items.
QColor rasterStrokeColor() const
Returns the stroke color for the stroke drawn around raster symbol items.
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
QSizeF wmsLegendSize() const
QgsLegendStyle style(QgsLegendStyle::Style s) const
Returns style.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setMapScale(double scale)
Sets the legend map scale.
double rasterStrokeWidth() const
Returns the stroke width (in millimeters) for the stroke drawn around raster symbol items...
The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLege...
void setTitle(const QString &t)
void setRasterStrokeWidth(double width)
Sets the stroke width for the stroke drawn around raster symbol items.
Qt::AlignmentFlag titleAlignment() const
Returns the alignment of the legend title.
void setFontColor(const QColor &c)
void setColumnSpace(double s)
Style
Component of legends which can be styled.
QSizeF symbolSize() const
void setLineSpacing(double s)
void setLayerFontColor(const QColor &fontColor)
Sets layer font color to fontColor Overrides fontColor()
void setWmsLegendSize(QSizeF s)
QgsLegendStyle & rstyle(QgsLegendStyle::Style s)
Returns reference to modifiable style.
void setUseAdvancedEffects(bool use)
void setStyle(QgsLegendStyle::Style s, const QgsLegendStyle &style)
bool equalColumnWidth() const
void setColumnCount(int c)
double columnSpace() const
void setDrawRasterStroke(bool enabled)
Sets whether a stroke will be drawn around raster symbol items.
double lineSpacing() const
void setRasterStrokeColor(const QColor &color)
Sets the stroke color for the stroke drawn around raster symbol items.
double mmPerMapUnit() const
void setSplitLayer(bool s)