QGIS API Documentation  3.17.0-Master (57c5a6fc26)
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
CharacterWidget Class Reference

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

#include <characterwidget.h>

Inheritance diagram for CharacterWidget:
Inheritance graph
[legend]

Public Slots

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

Signals

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

Public Member Functions

 CharacterWidget (QWidget *parent=nullptr)
 Constructor for CharacterWidget. More...
 
QChar character () const
 Returns the currently selected character in the widget. More...
 
int columns () const
 Returns the number of columns of characters shown in the widget. More...
 
QFont font () const
 Returns the font shown in the widget. More...
 
QSize sizeHint () const override
 
int squareSize () const
 Returns the size (in pixels) of the square used to render each character preview. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 

Properties

QChar character
 
int columns
 
QFont font
 

Detailed Description

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

Definition at line 69 of file characterwidget.h.

Constructor & Destructor Documentation

◆ CharacterWidget()

CharacterWidget::CharacterWidget ( QWidget *  parent = nullptr)

Constructor for CharacterWidget.

Definition at line 59 of file characterwidget.cpp.

Member Function Documentation

◆ character()

QChar CharacterWidget::character ( ) const
inline

Returns the currently selected character in the widget.

See also
setCharacter()
Since
QGIS 3.0

Definition at line 100 of file characterwidget.h.

◆ characterSelected

void CharacterWidget::characterSelected ( QChar  character)
signal

Emitted when a character is selected in the widget.

◆ clearCharacter

void CharacterWidget::clearCharacter ( )
slot

Clears the currently selected character in the widget.

See also
character()
setCharacter()

Definition at line 131 of file characterwidget.cpp.

◆ columns()

int CharacterWidget::columns ( ) const
inline

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

Definition at line 88 of file characterwidget.h.

◆ font()

QFont CharacterWidget::font ( ) const
inline

Returns the font shown in the widget.

See also
setFont()
Since
QGIS 3.0

Definition at line 107 of file characterwidget.h.

◆ keyPressEvent()

void CharacterWidget::keyPressEvent ( QKeyEvent *  event)
overrideprotected

Definition at line 142 of file characterwidget.cpp.

◆ mouseMoveEvent()

void CharacterWidget::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 210 of file characterwidget.cpp.

◆ mousePressEvent()

void CharacterWidget::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 223 of file characterwidget.cpp.

◆ paintEvent()

void CharacterWidget::paintEvent ( QPaintEvent *  event)
overrideprotected

Definition at line 236 of file characterwidget.cpp.

◆ resizeEvent()

void CharacterWidget::resizeEvent ( QResizeEvent *  event)
overrideprotected

Definition at line 282 of file characterwidget.cpp.

◆ setCharacter

void CharacterWidget::setCharacter ( QChar  character)
slot

Sets the currently selected character in the widget.

See also
character()
characterSelected()

Definition at line 112 of file characterwidget.cpp.

◆ setColumns

void CharacterWidget::setColumns ( int  columns)
slot

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

Since
QGIS 3.0

Definition at line 103 of file characterwidget.cpp.

◆ setFont

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

Sets the font to show in the widget.

See also
font()
Since
QGIS 3.0

Definition at line 66 of file characterwidget.cpp.

◆ setFontSize

void CharacterWidget::setFontSize ( double  fontSize)
slot

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

Since
QGIS 3.0

Definition at line 74 of file characterwidget.cpp.

◆ setFontStyle

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

Sets the font style to show in the widget.

Since
QGIS 3.0

Definition at line 82 of file characterwidget.cpp.

◆ sizeHint()

QSize CharacterWidget::sizeHint ( ) const
override

Definition at line 137 of file characterwidget.cpp.

◆ squareSize()

int CharacterWidget::squareSize ( ) const
inline

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

Definition at line 93 of file characterwidget.h.

◆ updateFontMerging

void CharacterWidget::updateFontMerging ( bool  enable)
slot

Definition at line 93 of file characterwidget.cpp.

Property Documentation

◆ character

QChar CharacterWidget::character
readwrite

Definition at line 72 of file characterwidget.h.

◆ columns

int CharacterWidget::columns
readwrite

Definition at line 73 of file characterwidget.h.

◆ font

QFont CharacterWidget::font
readwrite

Definition at line 74 of file characterwidget.h.


The documentation for this class was generated from the following files: