1#ifndef CYBER_LONG_TEXT_DISPLAY_H
2#define CYBER_LONG_TEXT_DISPLAY_H
35 void SetText(
const QString &text);
50 [[nodiscard]] QSize
sizeHint()
const override;
QSize sizeHint() const override
Returns the recommended size for the widget based on the processed text content. The height is calcul...
Definition long_text_display_effect.cpp:30
QStringList processed_lines_
List of strings representing the text after processing (line wrapping).
Definition long_text_display_effect.h:101
QSize minimumSizeHint() const override
Definition long_text_display_effect.cpp:37
void resizeEvent(QResizeEvent *event) override
Overridden resize event handler. Invalidates the processed text cache and triggers delayed text proce...
Definition long_text_display_effect.cpp:90
QFont font_
The font used for rendering text and calculating metrics.
Definition long_text_display_effect.h:105
void ProcessText()
Processes the original_text_ into wrapped lines based on the current widget width....
Definition long_text_display_effect.cpp:96
LongTextDisplayEffect(QString text, const QColor &text_color, QWidget *parent=nullptr)
Constructs a CyberLongTextDisplay widget. Initializes the widget with default size policies,...
Definition long_text_display_effect.cpp:5
void SetText(const QString &text)
Sets the text content to be displayed. Updates the internal original text, invalidates the processed ...
Definition long_text_display_effect.cpp:16
bool cached_text_valid_
Flag indicating if the processed_lines_ cache is up to date with the original_text_ and widget width.
Definition long_text_display_effect.h:111
QString original_text_
The original, unprocessed text content set via constructor or SetText().
Definition long_text_display_effect.h:99
int scroll_position_
Current vertical scroll position in pixels.
Definition long_text_display_effect.h:109
QTimer * update_timer_
Timer used to delay text processing after resize or text change events.
Definition long_text_display_effect.h:113
void SetTextColor(const QColor &color)
Sets the color for the displayed text. Updates the internal text color and schedules a repaint.
Definition long_text_display_effect.cpp:24
void paintEvent(QPaintEvent *event) override
Overridden paint event handler. Draws the widget's appearance. Ensures the text is processed,...
Definition long_text_display_effect.cpp:49
void SetScrollPosition(int position)
Sets the vertical scroll position. This determines which part of the processed text is rendered in th...
Definition long_text_display_effect.cpp:42
void contentHeightChanged(int new_height)
Emitted after ProcessText() finishes, indicating the total calculated height required to display all ...
QSize size_hint_
Cached size hint calculated based on processed text dimensions.
Definition long_text_display_effect.h:107
QColor text_color_
The color used to render the text.
Definition long_text_display_effect.h:103