![]() |
NDEVR
API Documentation
|
Displays translated text. More...
Public Types | |
| enum | Theme { e_header_a , e_label_a , e_label_b } |
| Options for how to display the label. More... | |
Public Member Functions | |
| QCustomLabel (const QString &text, QWidget *parent=nullptr) | |
| Constructs a QCustomLabel with a QString and the given parent widget. | |
| QCustomLabel (const TranslatedString &text, QWidget *parent=nullptr) | |
| Constructs a QCustomLabel with translated text and the given parent widget. | |
| QCustomLabel (QWidget *parent=nullptr) | |
| Constructs a QCustomLabel with the given parent widget. | |
| bool | event (QEvent *event) override |
| Handles generic events such as theme and font changes. | |
| QSize | minimumSizeHint () const override |
| Returns the minimum size hint, accounting for vertical orientation. | |
| void | paintEvent (QPaintEvent *e) override |
| Custom paint event that handles vertical and flipped text rendering. | |
| void | setBold (bool is_bold) |
| Sets whether the label text is rendered in bold. | |
| void | setFlipped (bool flipped) |
| Sets whether the label text is rendered upside-down (flipped 180 degrees). | |
| void | setFontMultiplier (fltp04 font_multiplier) |
| Sets a multiplier applied to the base font size. | |
| void | setLabelTheme (Theme theme) |
| Sets the visual theme of the label. | |
| void | setText (const char *text) |
| Sets the label text from a C-string. | |
| void | setText (const QString &text) |
| Sets the label text from a QString. | |
| void | setText (const String &text) |
| Sets the label text from an NDEVR String. | |
| void | setText (const TranslatedString &text) |
| Sets the label text from a TranslatedString. | |
| void | setVertical (bool vertical) |
| Sets whether the label text is rendered vertically. | |
| QSize | sizeHint () const override |
| Returns the recommended size, accounting for vertical orientation. | |
| TranslatedString | text () const |
| Returns the current label text as a TranslatedString. | |
Static Public Attributes | |
| static Resource< fltp08 > | default_multiplier_desktop |
| Default font multiplier for desktop mode. | |
| static Resource< fltp08 > | default_multiplier_touch |
| Default font multiplier for touch mode. | |
Protected Member Functions | |
| void | init () |
| Initializes the label with default settings. | |
| void | updateFont () |
| Updates the font based on the current multiplier, bold, and theme settings. | |
Protected Attributes | |
| fltp04 | m_font_multiplier |
| The current font size multiplier. | |
| bool | m_is_bold = false |
| Whether the text is rendered in bold. | |
| bool | m_is_flipped = false |
| Whether the text is rendered upside-down. | |
| bool | m_is_vertical = false |
| Whether the text is rendered vertically. | |
| Theme | m_theme |
| The current visual theme. | |
| TranslatedString | m_translated_text |
| The stored translated text. | |
Displays translated text.
No user interaction functionality is provided. The visual appearance of the label can be configured in various ways.
Definition at line 46 of file QCustomLabel.h.
| enum QCustomLabel::Theme |
Options for how to display the label.
| Enumerator | |
|---|---|
| e_header_a | For titles: standard foreground color with bold font. |
| e_label_a | Default label style: uses highlight color. |
| e_label_b | Alternative label style: standard foreground color. |
Definition at line 52 of file QCustomLabel.h.
| QCustomLabel::QCustomLabel | ( | QWidget * | parent = nullptr | ) |
Constructs a QCustomLabel with the given parent widget.
| [in] | parent | The parent widget. |
| QCustomLabel::QCustomLabel | ( | const TranslatedString & | text, |
| QWidget * | parent = nullptr ) |
Constructs a QCustomLabel with translated text and the given parent widget.
| [in] | text | The translated text to display. |
| [in] | parent | The parent widget. |
References text().
| QCustomLabel::QCustomLabel | ( | const QString & | text, |
| QWidget * | parent = nullptr ) |
Constructs a QCustomLabel with a QString and the given parent widget.
| [in] | text | The text to display. |
| [in] | parent | The parent widget. |
References text().
|
override |
|
override |
Returns the minimum size hint, accounting for vertical orientation.
|
override |
Custom paint event that handles vertical and flipped text rendering.
| [in] | e | The paint event. |
| void QCustomLabel::setBold | ( | bool | is_bold | ) |
Sets whether the label text is rendered in bold.
| [in] | is_bold | Whether the text should be bold. |
| void QCustomLabel::setFlipped | ( | bool | flipped | ) |
Sets whether the label text is rendered upside-down (flipped 180 degrees).
| [in] | flipped | Whether to flip the text. |
| void QCustomLabel::setFontMultiplier | ( | fltp04 | font_multiplier | ) |
Sets a multiplier applied to the base font size.
| [in] | font_multiplier | The font size multiplier. |
| void QCustomLabel::setLabelTheme | ( | Theme | theme | ) |
Sets the visual theme of the label.
| [in] | theme | The theme to apply. |
| void QCustomLabel::setText | ( | const char * | text | ) |
| void QCustomLabel::setText | ( | const QString & | text | ) |
| void QCustomLabel::setText | ( | const String & | text | ) |
| void QCustomLabel::setText | ( | const TranslatedString & | text | ) |
Sets the label text from a TranslatedString.
| [in] | text | The translated text to display. |
References text().
| void QCustomLabel::setVertical | ( | bool | vertical | ) |
Sets whether the label text is rendered vertically.
| [in] | vertical | Whether to render text vertically. |
|
override |
Returns the recommended size, accounting for vertical orientation.
| TranslatedString QCustomLabel::text | ( | ) | const |
Returns the current label text as a TranslatedString.
Referenced by QCustomLabel(), QCustomLabel(), setText(), setText(), setText(), and setText().