18#include <QAbstractScrollArea>
25#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
26 QList<QTextLayout::FormatRange> fmt_list;
28 QVector<QTextLayout::FormatRange> fmt_list;
37 QList<TextLine> text_lines;
87 void markField(
int start,
int length,
bool scroll_to =
true,
bool hover =
false);
99 void markProtocol(
int start,
int length) {Q_UNUSED(start) Q_UNUSED(length)}
106 void markAppendix(
int start,
int length) {Q_UNUSED(start) Q_UNUSED(length)}
153 void updateLayoutMetrics();
160 int stringWidth(
const QString &line);
165 void updateScrollbars();
173 void addTextLine(
TextBlock &text_block,
TextLine &text_line,
const QString &next_line = QString());
181 bool prettyPrintPlain(
const char *in_buf, QString &out_str);
187 bool addJsonObject();
194 int offsetChars(
bool include_pad =
true);
207 const TextLine *findTextLine(
int line);
210 QTextLayout *layout_;
213 QList<TextBlock> text_blocks_;
228 qsizetype max_line_length_;
Abstract base class for widgets that display raw packet byte data.
Definition base_data_source_view.h:20
A view for displaying and interacting with JSON formatted data sources.
Definition json_data_source_view.h:44
void unmarkField()
Clears the currently marked field.
Definition json_data_source_view.cpp:112
void markField(int start, int length, bool scroll_to=true, bool hover=false)
Visually marks a field in the display.
Definition json_data_source_view.cpp:82
void setMonospaceFont(const QFont &mono_font)
Sets the monospace font used for rendering the JSON text.
Definition json_data_source_view.cpp:67
void fieldSelected(FieldInformation *finfo)
Signal emitted when a JSON field is selected.
virtual void leaveEvent(QEvent *event)
Handles leave events to clear hover states.
Definition json_data_source_view.cpp:294
virtual void mouseMoveEvent(QMouseEvent *event)
Handles mouse move events for hovering over fields.
Definition json_data_source_view.cpp:281
~JsonDataSourceView()
Destroys the JsonDataSourceView.
Definition json_data_source_view.cpp:61
void markProtocol(int start, int length)
Marks a protocol in the view (unused for JSON view).
Definition json_data_source_view.h:99
virtual void showEvent(QShowEvent *)
Handles show events.
Definition json_data_source_view.cpp:185
void fieldHighlight(FieldInformation *finfo)
Signal emitted when a JSON field is hovered or highlighted.
virtual void resizeEvent(QResizeEvent *)
Handles resize events to adjust the text layout.
Definition json_data_source_view.cpp:180
virtual void paintEvent(QPaintEvent *)
Handles paint events to draw the JSON text.
Definition json_data_source_view.cpp:118
virtual void keyPressEvent(QKeyEvent *)
Handles key press events for navigation.
Definition json_data_source_view.cpp:195
virtual void mousePressEvent(QMouseEvent *event)
Handles mouse press events for selecting fields.
Definition json_data_source_view.cpp:262
void markAppendix(int start, int length)
Marks the appendix in the view (unused for JSON view).
Definition json_data_source_view.h:106
Definition json_data_source_view.h:36
Definition json_data_source_view.h:23