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¶
Class Hierarchy¶
Base classes¶
Methods
Returns the currently selected character in the widget. |
|
Clears the currently selected character in the widget. |
|
Returns the number of columns of characters shown in the widget. |
|
Returns the font shown in the widget |
|
Sets the currently selected character in the widget. |
|
Sets the number of columns of characters to show in the widget. |
|
Sets the font to show in the widget. |
|
Sets the font size (in points) to render in the widget. |
|
Sets the font style to show in the widget. |
|
Returns the size (in pixels) of the square used to render each character preview. |
|
Signals
Emitted when a character is selected in the widget. |
- 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
- Return type:
str
- signal characterSelected(character: QChar)[source]¶
Emitted when a character is selected in the widget.
- Parameters:
character (QChar)
- clearCharacter(self)[source]¶
Clears the currently selected character in the widget.
See also
See also
- columns(self) int [source]¶
Returns the number of columns of characters shown in the widget.
- Return type:
int
- setCharacter(self, character: str)[source]¶
Sets the currently selected
character
in the widget.See also
See also
- 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
- 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])