| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
follow_stream_text.h
Go to the documentation of this file.
1
9
10#ifndef FOLLOW_STREAM_TEXT_H
11#define FOLLOW_STREAM_TEXT_H
12
13#include <QPlainTextEdit>
14
18 class FollowStreamText : public QPlainTextEdit
19{
20 Q_OBJECT
21 public:
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
56 protected:
61 void mouseMoveEvent(QMouseEvent *event) override;
62
67 void mousePressEvent(QMouseEvent *event) override;
68
73 void leaveEvent(QEvent *event) override;
74
75signals:
80 void mouseMovedToPacket(int packet_num);
81
86 void mouseClickedOnPacket(int packet_num);
87
88 public slots:
92 void clear();
93
94 private:
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
FollowStreamText::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
Handles mouse move events to track packet selection.
Definition follow_stream_text.cpp:130
FollowStreamText::isTruncated
bool isTruncated() const
Checks if the displayed text was truncated due to length limits.
Definition follow_stream_text.h:32
FollowStreamText::addDeltaTime
void addDeltaTime(double delta)
Adds a delta time metadata string to the display.
Definition follow_stream_text.cpp:104
FollowStreamText::mouseClickedOnPacket
void mouseClickedOnPacket(int packet_num)
Signal emitted when text belonging to a specific packet is clicked.
FollowStreamText::clear
void clear()
Clears the text display and internal mapping.
Definition follow_stream_text.cpp:153
FollowStreamText::mouseMovedToPacket
void mouseMovedToPacket(int packet_num)
Signal emitted when the mouse hovers over text belonging to a specific packet.
FollowStreamText::currentPacket
int currentPacket() const
Retrieves the packet number corresponding to the current cursor position.
Definition follow_stream_text.cpp:160
FollowStreamText::leaveEvent
void leaveEvent(QEvent *event) override
Handles events when the mouse leaves the widget.
Definition follow_stream_text.cpp:147
FollowStreamText::addText
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:60
FollowStreamText::FollowStreamText
FollowStreamText(QWidget *parent=0)
Constructs a new FollowStreamText widget.
Definition follow_stream_text.cpp:28
FollowStreamText::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Handles mouse press events to select specific packets.
Definition follow_stream_text.cpp:141