17#ifndef QGSLAYOUTITEMLABEL_H
18#define QGSLAYOUTITEMLABEL_H
59 int type()
const override;
60 QIcon
icon()
const override;
68 void adjustSizeToText();
84 QSizeF sizeForText()
const;
91 QString
text()
const {
return mText; }
97 void setText(
const QString &text );
104 QString currentText()
const;
117 void setMode( Mode mode );
131 Q_DECL_DEPRECATED
void setFont( const QFont &font )
SIP_DEPRECATED;
138 Qt::AlignmentFlag vAlign()
const {
return mVAlignment; }
145 Qt::AlignmentFlag
hAlign()
const {
return mHAlignment; }
188 void setMargin(
double margin );
196 void setMarginX(
double margin );
204 void setMarginY(
double margin );
222 QRectF boundingRect()
const override;
250 void convertToStaticText();
259 void refreshExpressionContext();
261 void updateBoundingRect();
267 Mode mMode = ModeFont;
268 double mHtmlUnitsToLayoutUnits = 1.0;
269 double htmlUnitsToLayoutUnits();
272 void itemShiftAdjustSize(
double newWidth,
double newHeight,
double &xShift,
double &yShift )
const;
275 void contentChanged();
280 double mMarginX = 0.0;
282 double mMarginY = 0.0;
285 Qt::AlignmentFlag mHAlignment = Qt::AlignLeft;
288 Qt::AlignmentFlag mVAlignment = Qt::AlignTop;
291 void replaceDateText( QString &text )
const;
294 QFont createDefaultFont()
const;
297 QUrl createStylesheetUrl()
const;
300 QString createStylesheet()
const;
302 std::unique_ptr< QgsDistanceArea > mDistanceArea;
304 QRectF mCurrentRectangle;
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A layout multiframe subclass for HTML content.
A layout item subclass for text labels.
Mode mode() const
Returns the label's current mode.
void setHAlign(Qt::AlignmentFlag alignment)
Sets the horizontal alignment of the label.
Q_DECL_DEPRECATED QColor fontColor() const
Returns the label font color.
double marginX() const
Returns the horizontal margin between the edge of the frame and the label contents,...
double marginY() const
Returns the vertical margin between the edge of the frame and the label contents, in layout units.
QString text() const
Returns the label's preset text.
Q_DECL_DEPRECATED void setFontColor(const QColor &color)
Sets the label font color.
void setVAlign(Qt::AlignmentFlag alignment)
Sets for the vertical alignment of the label.
Qt::AlignmentFlag hAlign() const
Returns the horizontal alignment of the label.
@ ModeHtml
Label displays rendered HTML content.
@ ModeFont
Label displays text rendered using a single font.
Contains settings and helpers relating to a render of a QgsLayoutItem.
Base class for graphical items within a QgsLayout.
virtual void setFrameStrokeWidth(QgsLayoutMeasurement width)
Sets the frame stroke width.
virtual QIcon icon() const
Returns the item's icon.
ReferencePoint
Fixed position reference point.
virtual bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Stores item state within an XML DOM element.
virtual void setFrameEnabled(bool drawFrame)
Sets whether this item has a frame drawn around it or not.
int type() const override
Returns a unique graphics item type identifier.
virtual QString displayName() const
Gets item display name.
virtual void invalidateCache()
Forces a deferred update of any cached image the item uses.
virtual bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
Sets item state from a DOM element.
void refresh() override
Refreshes the item, causing a recalculation of any property overrides and recalculation of its positi...
virtual void draw(QgsLayoutItemRenderContext &context)=0
Draws the item's contents using the specified item render context.
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
The class is used as a container of context for various read/write operations on other objects.
Container for all settings relating to text rendering.
Represents a vector layer which manages a vector based data sets.