Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
follow_stream_text.h
Go to the documentation of this file.
1
10#ifndef FOLLOW_STREAM_TEXT_H
11#define FOLLOW_STREAM_TEXT_H
12
13#include <QPlainTextEdit>
14
18class FollowStreamText : public QPlainTextEdit
19{
20 Q_OBJECT
21public:
26 explicit FollowStreamText(QWidget *parent = 0);
27
32 bool isTruncated() const { return truncated_; }
33
42 void addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize, bool marked);
43
48 void addDeltaTime(double delta);
49
54 int currentPacket() const;
55
56protected:
61 void mouseMoveEvent(QMouseEvent *event);
62
67 void mousePressEvent(QMouseEvent *event);
68
73 void leaveEvent(QEvent *event);
74
75signals:
80 void mouseMovedToPacket(int packet_num);
81
86 void mouseClickedOnPacket(int packet_num);
87
88public slots:
92 void clear();
93
94private:
100 int textPosToPacket(int text_pos) const;
101
106 void addTruncated(int cur_pos);
107
109 static const int max_document_length_;
110
112 bool truncated_;
113
115 QMap<int, uint32_t> text_pos_to_packet_;
116
118 QColor metainfo_fg_;
119};
120
121#endif // FOLLOW_STREAM_TEXT_H
A custom plain text edit widget for displaying followed stream data.
Definition follow_stream_text.h:19
bool isTruncated() const
Checks if the displayed text was truncated due to length limits.
Definition follow_stream_text.h:32
void addDeltaTime(double delta)
Adds a delta time metadata string to the display.
Definition follow_stream_text.cpp:103
void leaveEvent(QEvent *event)
Handles events when the mouse leaves the widget.
Definition follow_stream_text.cpp:146
void mouseClickedOnPacket(int packet_num)
Signal emitted when text belonging to a specific packet is clicked.
void clear()
Clears the text display and internal mapping.
Definition follow_stream_text.cpp:152
void mouseMovedToPacket(int packet_num)
Signal emitted when the mouse hovers over text belonging to a specific packet.
void mouseMoveEvent(QMouseEvent *event)
Handles mouse move events to track packet selection.
Definition follow_stream_text.cpp:129
int currentPacket() const
Retrieves the packet number corresponding to the current cursor position.
Definition follow_stream_text.cpp:159
void addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize, bool marked)
Adds a segment of text to the display.
Definition follow_stream_text.cpp:59
void mousePressEvent(QMouseEvent *event)
Handles mouse press events to select specific packets.
Definition follow_stream_text.cpp:140