|
QGIS API Documentation 3.99.0-Master (21b3aa880ba)
|
A widget for customizing text formatting settings. More...
#include <qgstextformatwidget.h>

Public Slots | |
| void | setDockMode (bool enabled) |
| Sets whether the widget should be shown in a compact dock mode. | |
Signals | |
| void | auxiliaryFieldCreated () |
| Emitted when an auxiliary field is created in the widget. | |
| void | widgetChanged () |
| Emitted when the text format defined by the widget changes. | |
Public Member Functions | |
| QgsTextFormatWidget (const QgsTextFormat &format=QgsTextFormat(), QgsMapCanvas *mapCanvas=nullptr, QWidget *parent=nullptr, QgsMapLayer *layer=nullptr) | |
| Constructor for QgsTextFormatWidget. | |
| ~QgsTextFormatWidget () override | |
| QgsSymbolWidgetContext | context () const |
| Returns the context in which the widget is shown, e.g., the associated map canvas and expression contexts. | |
| void | deactivateField (QgsPalLayerSettings::Property key) |
| Deactivate a field from data defined properties and update the corresponding button. | |
| QgsTextFormat | format (bool includeDataDefinedProperties=true) const |
| Returns the current formatting settings defined by the widget. | |
| virtual void | setContext (const QgsSymbolWidgetContext &context) |
| Sets the context in which the widget is shown, e.g., the associated map canvas and expression contexts. | |
| void | setFormat (const QgsTextFormat &format) |
| Sets the current formatting settings. | |
| Public Member Functions inherited from QgsExpressionContextGenerator | |
| virtual | ~QgsExpressionContextGenerator ()=default |
Protected Types | |
| enum | Mode { Text = 0 , Labeling } |
| Widget mode. More... | |
Protected Slots | |
| void | populateDataDefinedButtons () |
| Sets up connections required for data defined buttons, or updates the existing definition of these buttons. | |
| virtual void | saveFormat () |
| Saves the current text settings to a style entry. | |
| virtual void | setFormatFromStyle (const QString &name, QgsStyle::StyleEntity type, const QString &stylePath) |
| Sets the current text settings from a style entry. | |
| void | updateLinePlacementOptions () |
| Updates line placement options to reflect current state of widget. | |
| void | updatePlacementWidgets () |
| Updates label placement options to reflect current state of widget. | |
| void | updatePreview () |
| Updates the text preview. | |
Protected Member Functions | |
| QgsTextFormatWidget (QgsMapCanvas *mapCanvas, QWidget *parent, Mode mode, QgsMapLayer *layer=nullptr) | |
| Constructor for QgsTextFormatWidget. | |
| QgsExpressionContext | createExpressionContext () const override |
| This method needs to be reimplemented in all classes which implement this interface and return an expression context. | |
| Q_DECL_DEPRECATED void | enableDataDefinedAlignment (bool enable) |
| Update the enabled state of the data defined alignment buttons. | |
| Qgis::GeometryType | labelGeometryType () const |
| Returns the geometry type which will be used by the labeling engine when registering labels for the labeling settings currently defined by the widget. | |
| void | setPreviewBackground (const QColor &color) |
| Sets the background color for the text preview widget. | |
| void | setPropertyOverrideButtonsVisible (bool visible) |
| Toggles whether data defined buttons should be shown in the widget. | |
| void | updateWidgetForFormat (const QgsTextFormat &format) |
| Updates the widget's state to reflect the settings in a QgsTextFormat. | |
Protected Attributes | |
| QListWidgetItem * | mBackgroundItem = nullptr |
| Background widget item. | |
| QListWidgetItem * | mBufferItem = nullptr |
| Buffer widget item. | |
| QListWidgetItem * | mCalloutItem = nullptr |
| Callout widget item. | |
| QgsSymbolWidgetContext | mContext |
| Context in which widget is shown. | |
| QgsPropertyCollection | mDataDefinedProperties |
| Data defined properties as defined in the widget. | |
| QButtonGroup * | mDirectSymbBtnGrp = nullptr |
| Symbol direction button group. | |
| QListWidgetItem * | mFormattingItem = nullptr |
| Formatting widget item. | |
| Qgis::GeometryType | mGeomType = Qgis::GeometryType::Unknown |
| Geometry type for layer, if known. | |
| QgsMapLayer * | mLayer = nullptr |
| Associated vector layer. | |
| QgsMapCanvas * | mMapCanvas = nullptr |
| Associated map canvas. | |
| QList< QgsSymbolLayerReference > | mMaskedSymbolLayers |
| QListWidgetItem * | mMaskItem = nullptr |
| Mask widget item. | |
| int | mMinPixelLimit = 0 |
| Pixel size font limit. | |
| QListWidgetItem * | mPlacementItem = nullptr |
| Placement widget item. | |
| QButtonGroup * | mQuadrantBtnGrp = nullptr |
| Quadrant button group. | |
| QListWidgetItem * | mRenderingItem = nullptr |
| Rendering widget item. | |
| QListWidgetItem * | mShadowItem = nullptr |
| Shadow widget item. | |
| QgsStringReplacementCollection | mSubstitutions |
| Text substitution list. | |
| QList< QgsTextFormat::Tab > | mTabPositions |
| Tab positions. | |
| QListWidgetItem * | mTextItem = nullptr |
| Text widget item. | |
| QButtonGroup * | mUpsidedownBtnGrp = nullptr |
| Upside down labels button group. | |
Properties | |
| QgsTextFormat | format |
A widget for customizing text formatting settings.
QgsTextFormatWidget provides a widget for controlling the appearance of text rendered using QgsTextRenderer. The widget includes all settings contained within a QgsTextFormat, including shadow, background and buffer.
Additionally, the widget can handle labeling settings due to the large overlap between the text renderer settings and the labeling settings. This mode is possible by subclassing QgsTextFormatWidget and calling the protected constructor with a mode of Labeling.
Definition at line 51 of file qgstextformatwidget.h.
|
protected |
Widget mode.
| Enumerator | |
|---|---|
| Text | Default mode, show text formatting settings only. |
| Labeling | Show labeling settings in addition to text formatting settings. |
Definition at line 127 of file qgstextformatwidget.h.
| QgsTextFormatWidget::QgsTextFormatWidget | ( | const QgsTextFormat & | format = QgsTextFormat(), |
| QgsMapCanvas * | mapCanvas = nullptr, | ||
| QWidget * | parent = nullptr, | ||
| QgsMapLayer * | layer = nullptr ) |
Constructor for QgsTextFormatWidget.
| format | initial formatting settings to show in widget |
| mapCanvas | associated map canvas |
| parent | parent widget |
| layer | associated layer (vector or mesh) |
Definition at line 55 of file qgstextformatwidget.cpp.
|
override |
Definition at line 1193 of file qgstextformatwidget.cpp.
|
protected |
Constructor for QgsTextFormatWidget.
| mapCanvas | associated map canvas |
| parent | parent widget |
| mode | widget mode |
| layer | associated vector layer |
Definition at line 66 of file qgstextformatwidget.cpp.
|
signal |
Emitted when an auxiliary field is created in the widget.
| QgsSymbolWidgetContext QgsTextFormatWidget::context | ( | ) | const |
Returns the context in which the widget is shown, e.g., the associated map canvas and expression contexts.
Definition at line 1345 of file qgstextformatwidget.cpp.
|
overrideprotectedvirtual |
This method needs to be reimplemented in all classes which implement this interface and return an expression context.
Implements QgsExpressionContextGenerator.
Definition at line 2322 of file qgstextformatwidget.cpp.
| void QgsTextFormatWidget::deactivateField | ( | QgsPalLayerSettings::Property | key | ) |
Deactivate a field from data defined properties and update the corresponding button.
| key | The property key to deactivate |
Definition at line 1350 of file qgstextformatwidget.cpp.
|
inlineprotected |
Update the enabled state of the data defined alignment buttons.
Definition at line 159 of file qgstextformatwidget.h.
| QgsTextFormat QgsTextFormatWidget::format | ( | bool | includeDataDefinedProperties = true | ) | const |
Returns the current formatting settings defined by the widget.
If includateDataDefinedProperties is true, then data defined properties specified in the widget will be included in the format definition.
Definition at line 1214 of file qgstextformatwidget.cpp.
|
protected |
Returns the geometry type which will be used by the labeling engine when registering labels for the labeling settings currently defined by the widget.
Definition at line 2350 of file qgstextformatwidget.cpp.
|
protectedslot |
Sets up connections required for data defined buttons, or updates the existing definition of these buttons.
Definition at line 836 of file qgstextformatwidget.cpp.
|
protectedvirtualslot |
Saves the current text settings to a style entry.
Definition at line 2135 of file qgstextformatwidget.cpp.
|
virtual |
Sets the context in which the widget is shown, e.g., the associated map canvas and expression contexts.
Definition at line 1386 of file qgstextformatwidget.cpp.
|
slot |
Sets whether the widget should be shown in a compact dock mode.
| enabled | set to true to show in dock mode. |
Definition at line 737 of file qgstextformatwidget.cpp.
| void QgsTextFormatWidget::setFormat | ( | const QgsTextFormat & | format | ) |
Sets the current formatting settings.
Definition at line 1327 of file qgstextformatwidget.cpp.
|
protectedvirtualslot |
Sets the current text settings from a style entry.
Definition at line 2093 of file qgstextformatwidget.cpp.
|
protected |
Sets the background color for the text preview widget.
| color | background color |
Definition at line 1489 of file qgstextformatwidget.cpp.
|
protected |
Toggles whether data defined buttons should be shown in the widget.
Definition at line 722 of file qgstextformatwidget.cpp.
|
protectedslot |
Updates line placement options to reflect current state of widget.
Definition at line 1888 of file qgstextformatwidget.cpp.
|
protectedslot |
Updates label placement options to reflect current state of widget.
Definition at line 1502 of file qgstextformatwidget.cpp.
|
protectedslot |
|
protected |
Updates the widget's state to reflect the settings in a QgsTextFormat.
| format | source format |
Definition at line 1021 of file qgstextformatwidget.cpp.
|
signal |
Emitted when the text format defined by the widget changes.
|
protected |
Background widget item.
Definition at line 218 of file qgstextformatwidget.h.
|
protected |
Buffer widget item.
Definition at line 214 of file qgstextformatwidget.h.
|
protected |
Callout widget item.
Definition at line 222 of file qgstextformatwidget.h.
|
protected |
Context in which widget is shown.
Definition at line 196 of file qgstextformatwidget.h.
|
protected |
Data defined properties as defined in the widget.
Definition at line 199 of file qgstextformatwidget.h.
|
protected |
Symbol direction button group.
Definition at line 186 of file qgstextformatwidget.h.
|
protected |
Formatting widget item.
Definition at line 212 of file qgstextformatwidget.h.
|
protected |
Geometry type for layer, if known.
Definition at line 207 of file qgstextformatwidget.h.
|
protected |
Associated vector layer.
Definition at line 202 of file qgstextformatwidget.h.
|
protected |
Associated map canvas.
Definition at line 193 of file qgstextformatwidget.h.
|
protected |
Definition at line 204 of file qgstextformatwidget.h.
|
protected |
Mask widget item.
Definition at line 216 of file qgstextformatwidget.h.
|
protected |
Pixel size font limit.
Definition at line 190 of file qgstextformatwidget.h.
|
protected |
Placement widget item.
Definition at line 224 of file qgstextformatwidget.h.
|
protected |
Quadrant button group.
Definition at line 184 of file qgstextformatwidget.h.
|
protected |
Rendering widget item.
Definition at line 226 of file qgstextformatwidget.h.
|
protected |
Shadow widget item.
Definition at line 220 of file qgstextformatwidget.h.
|
protected |
Text substitution list.
Definition at line 179 of file qgstextformatwidget.h.
|
protected |
Tab positions.
Definition at line 181 of file qgstextformatwidget.h.
|
protected |
Text widget item.
Definition at line 210 of file qgstextformatwidget.h.
|
protected |
Upside down labels button group.
Definition at line 188 of file qgstextformatwidget.h.
|
read |
Definition at line 54 of file qgstextformatwidget.h.