Class: QgsTextPreview¶
-
class
qgis.gui.
QgsTextPreview
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QLabel
Constructor for QgsTextPreview
- Parameters
parent – parent widget
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().
New in version 3.0: Enums
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.
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.Signals
Attributes
-
actionEvent
()¶
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
drawFrame
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
format
(self) → QgsTextFormat¶ Returns the text format used for previewing text in the widget.
See also
-
hideEvent
()¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
mapUnits
(self) → QgsUnitTypes.DistanceUnit¶ Returns the map unit type used for previewing format sizes in map units.
See also
See also
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
(self, e: QPaintEvent)¶
-
receivers
()¶
-
resizeEvent
()¶
-
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
-
sender
()¶
-
senderSignalIndex
()¶
-
setFormat
(self, format: QgsTextFormat)¶ Sets the text format for previewing in the widget.
- Parameters
format – text format
See also
-
setMapUnits
(self, unit: QgsUnitTypes.DistanceUnit)¶ Sets the map unit type for previewing format sizes in map units.
- Parameters
unit – 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
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶