NDEVR
API Documentation
QCustomTextEdit

A widget that is used to edit and display both plain and rich text in a multi-lined format. More...

Collaboration diagram for QCustomTextEdit:
[legend]

Public Member Functions

 QCustomTextEdit (QWidget *parent=nullptr)
 Constructs a multi-line text edit widget.
void editedSignal ()
 Signal emitted when the user edits the text content.
void editingFinishedSignal ()
 Signal emitted when the user finishes editing (focus lost or Enter pressed).
virtual void focusInEvent (QFocusEvent *e) override
 Handles focus-in events to update placeholder and input hint state.
String getValue () const
 Returns the current text content as an NDEVR String.
void inputHintChangedSignal ()
 Signal emitted when the input hint changes due to focus or content changes.
void keyPressEvent (QKeyEvent *e) override
 Handles key press events, including special handling for Enter/Return keys.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for the text edit.
virtual void mousePressEvent (QMouseEvent *e) override
 Handles mouse press events for touch-friendly interaction.
void setEditable (bool is_editable)
 Sets whether the text edit is editable by the user.
void setHeightMultiplier (fltp04 multiplier)
 Sets a multiplier for the height component of the size hint.
void setTitle (const TranslatedString &title)
 Sets the title used as a placeholder or label for the text edit.
void setup (const TranslatedString &title, Resource< String > &value)
 Sets up the text edit with a title and two-way binding to a string resource.
void setup (GenericOption &option)
 Sets up the text edit from a GenericOption, binding the value and title.
void setValue (const String &text)
 Sets the text content of the text edit.
QSize sizeHint () const override
 Returns the recommended size for the text edit.

Protected Member Functions

bool event (QEvent *event) override
 Handles general events including tooltip and palette change events.
void onUserEditedCore ()
 Processes user edits, emitting signals and updating bound resources.

Protected Attributes

fltp04 m_height_hint_multiplier = 1.0f
 Multiplier applied to the height component of size hints.
QTResourceListenerm_resource_changed_listener = nullptr
 Listener for external resource changes to update the text.
TranslatedString m_title
 The title text used as a placeholder label.

Detailed Description

A widget that is used to edit and display both plain and rich text in a multi-lined format.


Definition at line 48 of file QCustomTextEdit.h.

Constructor & Destructor Documentation

◆ QCustomTextEdit()

QCustomTextEdit::QCustomTextEdit ( QWidget * parent = nullptr)

Constructs a multi-line text edit widget.

Parameters
[in]parentThe parent widget, or nullptr for no parent.

References QCustomTextEdit().

Referenced by QCustomTextEdit().

Member Function Documentation

◆ event()

bool QCustomTextEdit::event ( QEvent * event)
overrideprotected

Handles general events including tooltip and palette change events.

Parameters
[in]eventThe event to handle.
Returns
True if the event was handled, false otherwise.

References event().

Referenced by event().

◆ focusInEvent()

virtual void QCustomTextEdit::focusInEvent ( QFocusEvent * e)
overridevirtual

Handles focus-in events to update placeholder and input hint state.

Parameters
[in]eThe focus-in event.

◆ getValue()

String QCustomTextEdit::getValue ( ) const

Returns the current text content as an NDEVR String.

Returns
The current text value.

◆ keyPressEvent()

void QCustomTextEdit::keyPressEvent ( QKeyEvent * e)
override

Handles key press events, including special handling for Enter/Return keys.

Parameters
[in]eThe key press event.

◆ minimumSizeHint()

QSize QCustomTextEdit::minimumSizeHint ( ) const
override

Returns the minimum recommended size for the text edit.

Returns
The minimum QSize for layout calculations.

◆ mousePressEvent()

virtual void QCustomTextEdit::mousePressEvent ( QMouseEvent * e)
overridevirtual

Handles mouse press events for touch-friendly interaction.

Parameters
[in]eThe mouse press event.

◆ setEditable()

void QCustomTextEdit::setEditable ( bool is_editable)

Sets whether the text edit is editable by the user.

Parameters
[in]is_editableTrue to allow editing, false for read-only.

◆ setHeightMultiplier()

void QCustomTextEdit::setHeightMultiplier ( fltp04 multiplier)

Sets a multiplier for the height component of the size hint.

Parameters
[in]multiplierThe height multiplier to apply.

◆ setTitle()

void QCustomTextEdit::setTitle ( const TranslatedString & title)

Sets the title used as a placeholder or label for the text edit.

Parameters
[in]titleThe translated title text.

◆ setup() [1/2]

void QCustomTextEdit::setup ( const TranslatedString & title,
Resource< String > & value )

Sets up the text edit with a title and two-way binding to a string resource.

Parameters
[in]titleThe translated title text.
[in]valueThe string resource to bind to.

◆ setup() [2/2]

void QCustomTextEdit::setup ( GenericOption & option)

Sets up the text edit from a GenericOption, binding the value and title.

Parameters
[in]optionThe generic option to configure from.

◆ setValue()

void QCustomTextEdit::setValue ( const String & text)

Sets the text content of the text edit.

Parameters
[in]textThe new text value.

◆ sizeHint()

QSize QCustomTextEdit::sizeHint ( ) const
override

Returns the recommended size for the text edit.

Returns
The recommended QSize for layout calculations.

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