QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
A widget for previewing text formatting settings. More...
#include <qgstextpreview.h>
Public Member Functions | |
QgsTextPreview (QWidget *parent=nullptr) | |
Constructor for QgsTextPreview. More... | |
QgsTextFormat | format () const |
Returns the text format used for previewing text in the widget. More... | |
QgsUnitTypes::DistanceUnit | mapUnits () const |
Returns the map unit type used for previewing format sizes in map units. More... | |
void | paintEvent (QPaintEvent *e) override |
double | scale () const |
Returns the scale used for previewing format sizes in map units. More... | |
void | setFormat (const QgsTextFormat &format) |
Sets the text format for previewing in the widget. More... | |
void | setMapUnits (QgsUnitTypes::DistanceUnit unit) |
Sets the map unit type for previewing format sizes in map units. More... | |
void | setScale (double scale) |
Sets the scale to use for previewing format sizes in map units. More... | |
Properties | |
QgsTextFormat | format |
QgsUnitTypes::DistanceUnit | mapUnits |
double | scale |
A widget for previewing text formatting settings.
QgsTextPreview provides a widget for previewing the appearance of text rendered using QgsTextRenderer. The preview includes all settings contained within a QgsTextFormat, including shadow, background and buffer.
In order to preview the exact appearance of text which uses sizes in map units, the scale and map units must be set by calling setScale() and setMapUnits().
Definition at line 39 of file qgstextpreview.h.
QgsTextPreview::QgsTextPreview | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsTextPreview.
parent | parent widget |
Definition at line 22 of file qgstextpreview.cpp.
|
inline |
Returns the text format used for previewing text in the widget.
Definition at line 68 of file qgstextpreview.h.
|
inline |
Returns the map unit type used for previewing format sizes in map units.
Definition at line 99 of file qgstextpreview.h.
|
override |
Definition at line 39 of file qgstextpreview.cpp.
|
inline |
Returns the scale used for previewing format sizes in map units.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
Definition at line 84 of file qgstextpreview.h.
void QgsTextPreview::setFormat | ( | const QgsTextFormat & | format | ) |
Sets the text format for previewing in the widget.
format | text format |
Definition at line 75 of file qgstextpreview.cpp.
void QgsTextPreview::setMapUnits | ( | QgsUnitTypes::DistanceUnit | unit | ) |
Sets the map unit type for previewing format sizes in map units.
unit | map units |
Definition at line 97 of file qgstextpreview.cpp.
void QgsTextPreview::setScale | ( | double | scale | ) |
Sets the scale to use for previewing format sizes in map units.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
Definition at line 91 of file qgstextpreview.cpp.
|
readwrite |
Definition at line 1 of file qgstextpreview.h.
|
readwrite |
Definition at line 1 of file qgstextpreview.h.
|
readwrite |
Definition at line 1 of file qgstextpreview.h.