QGIS API Documentation
3.2.0-Bonn (bc43194)
|
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. More... | |
Signals | |
void | widgetChanged () |
Emitted when the text format defined by the widget changes. More... | |
Public Member Functions | |
QgsTextFormatWidget (const QgsTextFormat &format=QgsTextFormat(), QgsMapCanvas *mapCanvas=nullptr, QWidget *parent=nullptr) | |
Constructor for QgsTextFormatWidget. More... | |
~QgsTextFormatWidget () override | |
QgsTextFormat | format () const |
Returns the current formatting settings defined by the widget. More... | |
void | setFormat (const QgsTextFormat &format) |
Sets the current formatting settings. More... | |
Protected Types | |
enum | Mode { Text = 0, Labeling } |
Widget mode. More... | |
Protected Slots | |
void | updateLinePlacementOptions () |
Updates line placement options to reflect current state of widget. More... | |
void | updatePlacementWidgets () |
Updates label placement options to reflect current state of widget. More... | |
Protected Member Functions | |
QgsTextFormatWidget (QgsMapCanvas *mapCanvas, QWidget *parent, Mode mode) | |
Constructor for QgsTextFormatWidget. More... | |
void | enableDataDefinedAlignment (bool enable) |
Controls whether data defined alignment buttons are enabled. More... | |
void | setPreviewBackground (const QColor &color) |
Sets the background color for the text preview widget. More... | |
void | updateWidgetForFormat (const QgsTextFormat &format) |
Updates the widget's state to reflect the settings in a QgsTextFormat. More... | |
Protected Attributes | |
QButtonGroup * | mDirectSymbBtnGrp = nullptr |
Symbol direction button group. More... | |
int | mMinPixelLimit = 0 |
Pixel size font limit. More... | |
QButtonGroup * | mPlaceLineBtnGrp = nullptr |
Line placement button group. More... | |
QButtonGroup * | mPlacePointBtnGrp = nullptr |
Point placement button group. More... | |
QButtonGroup * | mPlacePolygonBtnGrp = nullptr |
Polygon placement button group. More... | |
QButtonGroup * | mQuadrantBtnGrp = nullptr |
Quadrant button group. More... | |
QgsStringReplacementCollection | mSubstitutions |
Text substitution list. More... | |
QButtonGroup * | mUpsidedownBtnGrp = nullptr |
Upside down labels button group. More... | |
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 49 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 93 of file qgstextformatwidget.h.
QgsTextFormatWidget::QgsTextFormatWidget | ( | const QgsTextFormat & | format = QgsTextFormat() , |
QgsMapCanvas * | mapCanvas = nullptr , |
||
QWidget * | parent = nullptr |
||
) |
Constructor for QgsTextFormatWidget.
format | initial formatting settings to show in widget |
mapCanvas | associated map canvas |
parent | parent widget |
Definition at line 34 of file qgstextformatwidget.cpp.
|
override |
Definition at line 739 of file qgstextformatwidget.cpp.
|
protected |
Constructor for QgsTextFormatWidget.
mapCanvas | associated map canvas |
parent | parent widget |
mode | widget mode |
Definition at line 43 of file qgstextformatwidget.cpp.
|
protected |
Controls whether data defined alignment buttons are enabled.
enable | set to true to enable alignment controls |
Definition at line 1436 of file qgstextformatwidget.cpp.
QgsTextFormat QgsTextFormatWidget::format | ( | ) | const |
Returns the current formatting settings defined by the widget.
|
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 536 of file qgstextformatwidget.cpp.
void QgsTextFormatWidget::setFormat | ( | const QgsTextFormat & | format | ) |
Sets the current formatting settings.
Definition at line 831 of file qgstextformatwidget.cpp.
|
protected |
Sets the background color for the text preview widget.
color | background color |
Definition at line 925 of file qgstextformatwidget.cpp.
|
protectedslot |
Updates line placement options to reflect current state of widget.
Definition at line 1220 of file qgstextformatwidget.cpp.
|
protectedslot |
Updates label placement options to reflect current state of widget.
Definition at line 938 of file qgstextformatwidget.cpp.
|
protected |
Updates the widget's state to reflect the settings in a QgsTextFormat.
format | source format |
Definition at line 615 of file qgstextformatwidget.cpp.
|
signal |
Emitted when the text format defined by the widget changes.
|
protected |
Symbol direction button group.
Definition at line 130 of file qgstextformatwidget.h.
|
protected |
Pixel size font limit.
Definition at line 140 of file qgstextformatwidget.h.
|
protected |
Line placement button group.
Definition at line 136 of file qgstextformatwidget.h.
|
protected |
Point placement button group.
Definition at line 134 of file qgstextformatwidget.h.
|
protected |
Polygon placement button group.
Definition at line 138 of file qgstextformatwidget.h.
|
protected |
Quadrant button group.
Definition at line 128 of file qgstextformatwidget.h.
|
protected |
Text substitution list.
Definition at line 126 of file qgstextformatwidget.h.
|
protected |
Upside down labels button group.
Definition at line 132 of file qgstextformatwidget.h.
|
read |
Definition at line 52 of file qgstextformatwidget.h.