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; }
181 int dpi()
const {
return mDpi; }
205 QStringList splitStringForWrapping(
const QString &stringToSplt )
const;
211 void drawText( QPainter *p,
double x,
double y,
const QString &text,
const QFont &font )
const;
223 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;
226 QFont scaledFontPixelSize(
const QFont &font )
const;
229 double pixelFontSize(
double pointSize )
const;
232 double textWidthMillimeters(
const QFont &font,
const QString &text )
const;
235 double fontHeightCharacterMM(
const QFont &font, QChar
c )
const;
238 double fontAscentMillimeters(
const QFont &font )
const;
241 double fontDescentMillimeters(
const QFont &font )
const;
248 Qt::AlignmentFlag mTitleAlignment = Qt::AlignLeft;
261 QSizeF mWmsLegendSize;
264 double mLineSpacing = 1;
267 double mColumnSpace = 2;
270 int mColumnCount = 1;
273 bool mSplitLayer =
false;
276 bool mEqualColumnWidth =
false;
278 bool mRasterSymbolStroke =
true;
279 QColor mRasterStrokeColor;
280 double mRasterStrokeWidth = 0.0;
282 QMap<QgsLegendStyle::Style, QgsLegendStyle> mStyleMap;
285 double mMmPerMapUnit = 1;
288 bool mUseAdvancedEffects =
true;
291 double mMapScale = 1;
299 #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)
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 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)