Class: QgsTextPreview¶
- class qgis.gui.QgsTextPreview¶
Bases:
PyQt5.QtWidgets.QLabel
A widget for previewing text formatting settings.
QgsTextPreview
provides a widget for previewing the appearance of text rendered usingQgsTextRenderer
. The preview includes all settings contained within aQgsTextFormat
, 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()
andsetMapUnits()
.New in version 3.0.
QgsTextPreview(parent: QWidget = None) Constructor for QgsTextPreview
- Parameters:
parent –
parent widget
Methods
Returns the text format used for previewing text in the widget.
Returns the map unit type used for previewing format sizes in map units.
- param e:
Returns the scale used for previewing format sizes in map units.
Sets the text format for previewing in the widget.
Sets the map unit type for previewing format sizes in map units.
Sets the
scale
to use for previewing format sizes in map units.
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- drawFrame(self, QPainter)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- format(self) QgsTextFormat ¶
Returns the text format used for previewing text in the widget.
See also
- Return type:
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionFrame)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- mapUnits(self) Qgis.DistanceUnit ¶
Returns the map unit type used for previewing format sizes in map units.
See also
See also
- Return type:
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, e: QPaintEvent)¶
- Parameters:
e (QPaintEvent) –
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- scale(self) float ¶
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.
See also
See also
- Return type:
float
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setFormat(self, format: QgsTextFormat)¶
Sets the text format for previewing in the widget.
- Parameters:
format (QgsTextFormat) – text format
See also
- setMapUnits(self, unit: Qgis.DistanceUnit)¶
Sets the map unit type for previewing format sizes in map units.
- Parameters:
unit (Qgis.DistanceUnit) – map units
See also
See also
- setScale(self, scale: float)¶
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.See also
See also
- Parameters:
scale (float) –
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶