Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
tagging_rules_delegate.h
1/* tagging_rules_delegate.h
2 *
3 * Delegate for editing tagging rule fields
4 * Copyright 2026, Mark Stout <[email protected]>
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <[email protected]>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13#ifndef TAGGING_RULES_DELEGATE_H
14#define TAGGING_RULES_DELEGATE_H
15
16#include <config.h>
17
18#include <QStyledItemDelegate>
19#include <QModelIndex>
20
21class TaggingRulesDelegate : public QStyledItemDelegate
22{
23 Q_OBJECT
24
25public:
26 TaggingRulesDelegate(QObject *parent = nullptr);
27
28 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
29 const QModelIndex &index) const override;
30
31 void paint(QPainter *painter, const QStyleOptionViewItem &option,
32 const QModelIndex &index) const override;
33
34 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
35
36 void setModelData(QWidget *editor, QAbstractItemModel *model,
37 const QModelIndex &index) const override;
38
39 void updateEditorGeometry(QWidget *editor,
40 const QStyleOptionViewItem &option, const QModelIndex &index) const override;
41
42signals:
43 void invalidField(const QModelIndex &index, const QString &errMessage) const;
44 void validField(const QModelIndex &index) const;
45
46private slots:
47 void ruleNameChanged(const QString name);
48};
49
50#endif // TAGGING_RULES_DELEGATE_H