Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
tag_column_delegate.h
1/* tag_column_delegate.h
2 *
3 * Delegate for COL_TAG packet list column
4 * Copyright 2026, Mark Stout <mark.stout@markstout.com>
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13#ifndef TAG_COLUMN_DELEGATE_H
14#define TAG_COLUMN_DELEGATE_H
15
16#include <config.h>
17
18#include <QStyledItemDelegate>
19
20class QPainter;
22
23class TagColumnDelegate : public QStyledItemDelegate
24{
25 Q_OBJECT
26
27public:
28 explicit TagColumnDelegate(QWidget *parent = nullptr);
29
38 void setMultiColorDelegate(const MultiColorPacketDelegate *delegate) { multi_color_delegate_ = delegate; }
39
40 void paintContent(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
41
42protected:
43 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
44 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
45 bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
46
47private:
48 const MultiColorPacketDelegate *multi_color_delegate_;
49};
50
51#endif // TAG_COLUMN_DELEGATE_H
A delegate for rendering multi-colored packet items in a view.
Definition multi_color_packet_delegate.h:40
void setMultiColorDelegate(const MultiColorPacketDelegate *delegate)
Paint only the tag content (emoji/text), no background fill.
Definition tag_column_delegate.h:38