16 #ifndef QGSLEGENDSETTINGS_H 17 #define QGSLEGENDSETTINGS_H 19 #include "qgis_core.h" 42 void setTitle(
const QString &t ) { mTitle = t; }
43 QString
title()
const {
return mTitle; }
96 QColor
layerFontColor()
const {
return mLayerFontColor.isValid() ? mLayerFontColor : fontColor() ;}
203 double mapUnitsPerPixel()
const;
210 void setMapUnitsPerPixel(
double mapUnitsPerPixel );
212 int dpi()
const {
return mDpi; }
221 QStringList splitStringForWrapping(
const QString &stringToSplt )
const;
227 void drawText( QPainter *p,
double x,
double y,
const QString &text,
const QFont &font )
const;
239 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;
242 QFont scaledFontPixelSize(
const QFont &font )
const;
245 double pixelFontSize(
double pointSize )
const;
248 double textWidthMillimeters(
const QFont &font,
const QString &text )
const;
251 double fontHeightCharacterMM(
const QFont &font, QChar
c )
const;
254 double fontAscentMillimeters(
const QFont &font )
const;
257 double fontDescentMillimeters(
const QFont &font )
const;
264 Qt::AlignmentFlag mTitleAlignment = Qt::AlignLeft;
277 QSizeF mWmsLegendSize;
280 double mLineSpacing = 1;
283 double mColumnSpace = 2;
286 int mColumnCount = 1;
289 bool mSplitLayer =
false;
292 bool mEqualColumnWidth =
false;
294 bool mRasterSymbolStroke =
true;
295 QColor mRasterStrokeColor;
296 double mRasterStrokeWidth = 0.0;
298 QMap<QgsLegendStyle::Style, QgsLegendStyle> mStyleMap;
301 double mMmPerMapUnit = 1;
304 bool mUseAdvancedEffects =
true;
307 double mMapScale = 1;
313 QColor mLayerFontColor;
318 #endif // QGSLEGENDSETTINGS_H void setTitleAlignment(Qt::AlignmentFlag alignment)
Sets the alignment of the legend title.
void setWrapChar(const QString &t)
void setEqualColumnWidth(bool s)
void setBoxSpace(double s)
void setMmPerMapUnit(double mmPerMapUnit)
double lineSpacing() const
void setSymbolSize(QSizeF s)
double columnSpace() const
Composer legend components style.
double mmPerMapUnit() const
bool equalColumnWidth() const
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
void setMapScale(double scale)
Sets the legend map scale.
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.
void setFontColor(const QColor &c)
void setColumnSpace(double s)
QgsLegendStyle style(QgsLegendStyle::Style s) const
Returns style.
void setLineSpacing(double s)
void setLayerFontColor(const QColor &fontColor)
Sets layer font color to fontColor Overrides fontColor()
Qt::AlignmentFlag titleAlignment() const
Returns the alignment of the legend title.
double mapScale() const
Returns the legend map scale.
QColor layerFontColor() const
Returns layer font color, defaults to fontColor()
void setWmsLegendSize(QSizeF s)
bool drawRasterStroke() const
Returns whether a stroke will be drawn around raster symbol items.
QgsLegendStyle & rstyle(QgsLegendStyle::Style s)
Returns reference to modifiable style.
double rasterStrokeWidth() const
Returns the stroke width (in millimeters) for the stroke drawn around raster symbol items...
void setUseAdvancedEffects(bool use)
bool useAdvancedEffects() const
void setStyle(QgsLegendStyle::Style s, const QgsLegendStyle &style)
void setColumnCount(int c)
void setDrawRasterStroke(bool enabled)
Sets whether a stroke will be drawn around raster symbol items.
QSizeF symbolSize() const
QSizeF wmsLegendSize() const
void setRasterStrokeColor(const QColor &color)
Sets the stroke color for the stroke drawn around raster symbol items.
void setSplitLayer(bool s)
QColor rasterStrokeColor() const
Returns the stroke color for the stroke drawn around raster symbol items.