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; }
180 int dpi()
const {
return mDpi; }
189 QStringList splitStringForWrapping(
const QString &stringToSplt )
const;
195 void drawText( QPainter *p,
double x,
double y,
const QString &text,
const QFont &font )
const;
207 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;
210 QFont scaledFontPixelSize(
const QFont &font )
const;
213 double pixelFontSize(
double pointSize )
const;
216 double textWidthMillimeters(
const QFont &font,
const QString &text )
const;
219 double fontHeightCharacterMM(
const QFont &font, QChar
c )
const;
222 double fontAscentMillimeters(
const QFont &font )
const;
225 double fontDescentMillimeters(
const QFont &font )
const;
232 Qt::AlignmentFlag mTitleAlignment = Qt::AlignLeft;
245 QSizeF mWmsLegendSize;
248 double mLineSpacing = 1;
251 double mColumnSpace = 2;
254 int mColumnCount = 1;
257 bool mSplitLayer =
false;
260 bool mEqualColumnWidth =
false;
262 bool mRasterSymbolStroke =
true;
263 QColor mRasterStrokeColor;
264 double mRasterStrokeWidth = 0.0;
266 QMap<QgsLegendStyle::Style, QgsLegendStyle> mStyleMap;
269 double mMmPerMapUnit = 1;
272 bool mUseAdvancedEffects =
true;
275 double mMapScale = 1;
283 #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.
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)