17 #ifndef QGSCOMPOSERLABEL_H
18 #define QGSCOMPOSERLABEL_H
41 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
override;
44 void adjustSizeToText();
46 QString
text() {
return mText; }
47 void setText(
const QString& text );
50 void setHtmlState(
int state );
53 QString displayText()
const;
56 void setExpressionContext(
QgsFeature* feature,
QgsVectorLayer* layer, QMap<QString, QVariant> substitutions = ( QMap<QString, QVariant>() ) );
59 void setFont(
const QFont& f );
63 Qt::AlignmentFlag
vAlign()
const {
return mVAlignment; }
67 Qt::AlignmentFlag
hAlign()
const {
return mHAlignment; }
72 void setHAlign( Qt::AlignmentFlag a ) {mHAlignment = a;}
77 void setVAlign( Qt::AlignmentFlag a ) { mVAlignment = a; }
83 Q_DECL_DEPRECATED
double margin() {
return mMarginX; }
90 double marginX()
const {
return mMarginX; }
97 double marginY()
const {
return mMarginY; }
107 void setMargin(
const double m );
116 void setMarginX(
const double margin );
125 void setMarginY(
const double margin );
136 bool writeXML( QDomElement& elem, QDomDocument & doc )
const override;
142 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc )
override;
150 QRectF boundingRect()
const override;
161 void refreshExpressionContext();
165 void loadingHtmlFinished(
bool );
173 double mHtmlUnitsToMM;
174 double htmlUnitsToMM();
178 void itemShiftAdjustSize(
double newWidth,
double newHeight,
double& xShift,
double& yShift )
const;
192 Qt::AlignmentFlag mHAlignment;
195 Qt::AlignmentFlag mVAlignment;
198 void replaceDateText( QString& text )
const;
202 QMap<QString, QVariant> mSubstitutions;