CharacterWidget class

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

Constructors, destructors, conversion operators

CharacterWidget(QWidget* parent = nullptr)
Constructor for CharacterWidget.

Public functions

auto character() const -> QChar
Returns the currently selected character in the widget.
auto columns() const -> int
Returns the number of columns of characters shown in the widget.
auto font() const -> QFont
Returns the font shown in the widget.
auto squareSize() const -> int
Returns the size (in pixels) of the square used to render each character preview.

Signals

void characterSelected(QChar character)
Emitted when a character is selected in the widget.

Public slots

void setCharacter(QChar character)
Sets the currently selected character in the widget.
void setColumns(int columns)
Sets the number of columns of characters to show in the widget.
void setFont(const QFont& font)
Sets the font to show in the widget.
void setFontSize(double fontSize)
Sets the font size (in points) to render in the widget.
void setFontStyle(const QString& fontStyle)
Sets the font style to show in the widget.

Function documentation

QChar CharacterWidget::character() const

Returns the currently selected character in the widget.

QFont CharacterWidget::font() const

Returns the font shown in the widget.

void CharacterWidget::setCharacter(QChar character) public slot

Sets the currently selected character in the widget.

void CharacterWidget::setColumns(int columns) public slot

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

void CharacterWidget::setFont(const QFont& font) public slot

Sets the font to show in the widget.

void CharacterWidget::setFontSize(double fontSize) public slot

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

void CharacterWidget::setFontStyle(const QString& fontStyle) public slot

Sets the font style to show in the widget.