| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
related_packet_delegate.h
Go to the documentation of this file.
1
9
10#ifndef RELATED_PACKET_DELEGATE_H
11#define RELATED_PACKET_DELEGATE_H
12
13#include <config.h>
14
15#include "epan/conversation.h"
16
17#include <QHash>
18#include <QStyledItemDelegate>
19
20 class QPainter;
21 struct conversation;
22
28 class RelatedPacketDelegate : public QStyledItemDelegate
29{
30 Q_OBJECT
31 public:
36 RelatedPacketDelegate(QWidget *parent = 0);
37
41 void clear();
42
51 void setCurrentFrame(uint32_t current_frame);
52
58 void setConversation(struct conversation *conv);
59
60 public slots:
67 void addRelatedFrame(int frame_num, ft_framenum_type_t framenum_type = FT_FRAMENUM_NONE);
68
69 protected:
76 void initStyleOption(QStyleOptionViewItem *option,
77 const QModelIndex &index) const override;
78
85 void paint(QPainter *painter, const QStyleOptionViewItem &option,
86 const QModelIndex &index) const override;
87
94 QSize sizeHint(const QStyleOptionViewItem &option,
95 const QModelIndex &index) const override;
96
97 private:
98 QHash<int, ft_framenum_type_t> related_frames_;
99 struct conversation *conv_;
100 uint32_t current_frame_;
101
109 void drawArrow(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const;
110
118 void drawChevrons(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const;
119
125 void drawCheckMark(QPainter *painter, const QRect bbox) const;
126};
127
128#endif // RELATED_PACKET_DELEGATE_H
RelatedPacketDelegate::setCurrentFrame
void setCurrentFrame(uint32_t current_frame)
Sets the frame number of the currently selected packet.
Definition related_packet_delegate.cpp:370
RelatedPacketDelegate::RelatedPacketDelegate
RelatedPacketDelegate(QWidget *parent=0)
Constructs a RelatedPacketDelegate with no related frames or conversation.
Definition related_packet_delegate.cpp:42
RelatedPacketDelegate::sizeHint
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Returns the preferred size for the indicator cell.
Definition related_packet_delegate.cpp:294
RelatedPacketDelegate::clear
void clear()
Clears all related frame entries and resets the conversation pointer.
Definition related_packet_delegate.cpp:363
RelatedPacketDelegate::paint
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Paints the relationship indicator for the packet at index.
Definition related_packet_delegate.cpp:66
RelatedPacketDelegate::initStyleOption
void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override
Initialises the style option for a row, suppressing the default focus/selection highlight in the indi...
Definition related_packet_delegate.cpp:50
RelatedPacketDelegate::setConversation
void setConversation(struct conversation *conv)
Associates a conversation with the delegate so that conversation membership can be reflected in the r...
Definition related_packet_delegate.cpp:404
RelatedPacketDelegate::addRelatedFrame
void addRelatedFrame(int frame_num, ft_framenum_type_t framenum_type=FT_FRAMENUM_NONE)
Registers a frame as related to the current selection.
Definition related_packet_delegate.cpp:378
conversation.h
ft_framenum_type_t
enum ft_framenum_type ft_framenum_type_t
Convenience typedef for ft_framenum_type.
Definition ftypes.h:208
FT_FRAMENUM_NONE
@ FT_FRAMENUM_NONE
Definition ftypes.h:197
conversation
Definition conversation.h:282