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 )
34 , mUseAdvancedEffects( true )
57 list = stringToSplt.split(
wrapChar() );
61 #define FONT_WORKAROUND_SCALE 10 //scale factor for upscaling fontsize and downscaling painter
69 p->setFont( textFont );
71 p->scale( scaleFactor, scaleFactor );
77 void QgsLegendSettings::drawText( QPainter* p,
const QRectF& rect,
const QString& text,
const QFont& font, Qt::AlignmentFlag halignment, Qt::AlignmentFlag valignment,
int flags )
const
85 p->setFont( textFont );
87 p->scale( scaleFactor, scaleFactor );
88 p->drawText( scaledRect, halignment | valignment | flags, text );
95 QFont scaledFont = font;
97 scaledFont.setPixelSize( pixelSize );
103 return ( pointSize * 0.3527 );
109 QFontMetricsF fontMetrics( metricsFont );
116 QFontMetricsF fontMetrics( metricsFont );
123 QFontMetricsF fontMetrics( metricsFont );
130 QFontMetricsF fontMetrics( metricsFont );