21 : mTitle(
QObject::tr(
"Legend" ) )
22 , mTitleAlignment(
Qt::AlignLeft )
24 , mFontColor(
QColor( 0, 0, 0 ) )
27 , mWmsLegendSize( 50, 25 )
31 , mSplitLayer( false )
32 , mEqualColumnWidth( false )
33 , mRasterSymbolBorder( true )
34 , mRasterBorderColor(
Qt::black )
35 , mRasterBorderWidth( 0.0 )
37 , mUseAdvancedEffects( true )
64 #define FONT_WORKAROUND_SCALE 10 //scale factor for upscaling fontsize and downscaling painter 74 p->
scale( scaleFactor, scaleFactor );
90 p->
scale( scaleFactor, scaleFactor );
91 p->
drawText( scaledRect, halignment | valignment | flags, text );
98 QFont scaledFont = font;
106 return ( pointSize * 0.3527 );
double pixelFontSize(double pointSize) const
Calculates font to from point size to pixel size.
void drawText(QPainter *p, double x, double y, const QString &text, const QFont &font) const
Draws Text.
double fontAscentMillimeters(const QFont &font) const
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCAL...
QgsComposerLegendStyle & rstyle(QgsComposerLegendStyle::Style s)
Returns reference to modifiable style.
void setMargin(Side side, double margin)
void scale(qreal sx, qreal sy)
QStringList splitStringForWrapping(const QString &stringToSplt) const
Splits a string using the wrap char taking into account handling empty wrap char which means no wrapp...
double textWidthMillimeters(const QFont &font, const QString &text) const
Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE...
qreal width(const QString &text) const
void setPixelSize(int pixelSize)
void setFont(const QFont &font)
QFont scaledFontPixelSize(const QFont &font) const
Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE.
QRectF boundingRect(const QString &text) const
void drawText(const QPointF &position, const QString &text)
double fontHeightCharacterMM(const QFont &font, QChar c) const
Returns the font height of a character in millimeters.
void setPointSizeF(qreal pointSize)
#define FONT_WORKAROUND_SCALE
QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries)
double fontDescentMillimeters(const QFont &font) const
Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCA...