Class: CharacterWidget

A widget for displaying characters available in a preset font, and allowing users to select an individual character.

CharacterWidget in a default state

CharacterWidget in a default state

Class Hierarchy

Inheritance diagram of qgis.gui.CharacterWidget

Base classes

QWidget

QObject

QPaintDevice

class qgis.gui.CharacterWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for CharacterWidget.

Parameters:

parent (Optional[QWidget] = None)

character(self) str[source]

Returns the currently selected character in the widget.

See also

setCharacter()

Return type:

str

signal characterSelected[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

clearCharacter(self)[source]

Clears the currently selected character in the widget.

See also

character()

See also

setCharacter()

columns(self) int[source]

Returns the number of columns of characters shown in the widget.

Return type:

int

font(self) QFont[source]

Returns the font shown in the widget

See also

setFont()

Return type:

QFont

setCharacter(self, character: str)[source]

Sets the currently selected character in the widget.

See also

character()

Parameters:

character (str)

setColumns(self, columns: int)[source]

Sets the number of columns of characters to show in the widget.

Parameters:

columns (int)

setFont(self, font: QFont)[source]

Sets the font to show in the widget.

See also

font()

Parameters:

font (QFont)

setFontSize(self, fontSize: float)[source]

Sets the font size (in points) to render in the widget.

Parameters:

fontSize (float)

setFontStyle(self, fontStyle: str | None)[source]

Sets the font style to show in the widget.

Parameters:

fontStyle (Optional[str])

squareSize(self) int[source]

Returns the size (in pixels) of the square used to render each character preview.

Return type:

int

updateFontMerging(self, enable: bool)[source]
Parameters:

enable (bool)