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; }
97 QColor
layerFontColor()
const {
return mLayerFontColor.isValid() ? mLayerFontColor : fontColor() ;}
204 double mapUnitsPerPixel()
const;
211 void setMapUnitsPerPixel(
double mapUnitsPerPixel );
213 int dpi()
const {
return mDpi; }
237 QStringList splitStringForWrapping(
const QString &stringToSplt )
const;
243 void drawText( QPainter *p,
double x,
double y,
const QString &text,
const QFont &font )
const;
255 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;
258 QFont scaledFontPixelSize(
const QFont &font )
const;
261 double pixelFontSize(
double pointSize )
const;
264 double textWidthMillimeters(
const QFont &font,
const QString &text )
const;
267 double fontHeightCharacterMM(
const QFont &font, QChar
c )
const;
270 double fontAscentMillimeters(
const QFont &font )
const;
273 double fontDescentMillimeters(
const QFont &font )
const;
280 Qt::AlignmentFlag mTitleAlignment = Qt::AlignLeft;
293 QSizeF mWmsLegendSize;
296 double mLineSpacing = 1;
299 double mColumnSpace = 2;
302 int mColumnCount = 1;
305 bool mSplitLayer =
false;
308 bool mEqualColumnWidth =
false;
310 bool mRasterSymbolStroke =
true;
311 QColor mRasterStrokeColor;
312 double mRasterStrokeWidth = 0.0;
314 QMap<QgsLegendStyle::Style, QgsLegendStyle> mStyleMap;
317 double mMmPerMapUnit = 1;
320 bool mUseAdvancedEffects =
true;
323 double mMapScale = 1;
329 QColor mLayerFontColor;
334 #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 setSymbolSize(QSizeF s)
QColor layerFontColor() const
Returns layer font color, defaults to fontColor()
Composer legend components style.
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)
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)