QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
A widget for previewing text formatting settings. More...
#include <qgstextpreview.h>
Public Member Functions | |
QgsTextPreview (QWidget *parent=nullptr) | |
Constructor for QgsTextPreview. | |
QgsTextFormat | format () const |
Returns the text format used for previewing text in the widget. | |
Qgis::DistanceUnit | mapUnits () const |
Returns the map unit type used for previewing format sizes in map units. | |
void | paintEvent (QPaintEvent *e) override |
double | scale () const |
Returns the scale used for previewing format sizes in map units. | |
void | setFormat (const QgsTextFormat &format) |
Sets the text format for previewing in the widget. | |
void | setMapUnits (Qgis::DistanceUnit unit) |
Sets the map unit type for previewing format sizes in map units. | |
void | setScale (double scale) |
Sets the scale to use for previewing format sizes in map units. | |
Properties | |
QgsTextFormat | format |
Qgis::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 40 of file qgstextpreview.h.
QgsTextPreview::QgsTextPreview | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsTextPreview.
parent | parent widget |
Definition at line 23 of file qgstextpreview.cpp.
|
inline |
Returns the text format used for previewing text in the widget.
Definition at line 69 of file qgstextpreview.h.
|
inline |
Returns the map unit type used for previewing format sizes in map units.
Definition at line 100 of file qgstextpreview.h.
|
override |
Definition at line 46 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 85 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 87 of file qgstextpreview.cpp.
void QgsTextPreview::setMapUnits | ( | Qgis::DistanceUnit | unit | ) |
Sets the map unit type for previewing format sizes in map units.
unit | map units |
Definition at line 109 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 103 of file qgstextpreview.cpp.
|
readwrite |
Definition at line 44 of file qgstextpreview.h.
|
readwrite |
Definition at line 46 of file qgstextpreview.h.
|
readwrite |
Definition at line 45 of file qgstextpreview.h.