Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
uat_delegate.h
1 /* uat_delegate.h
2  * Delegates for editing various field types in a UAT record.
3  *
4  * Copyright 2016 Peter Wu <peter@lekensteyn.nl>
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 UAT_DELEGATE_H
14 #define UAT_DELEGATE_H
15 
16 #include <config.h>
17 #include <glib.h>
18 #include <epan/uat-int.h>
19 
20 #include <QStyledItemDelegate>
21 #include <QModelIndex>
22 
23 class UatDelegate : public QStyledItemDelegate
24 {
25  Q_OBJECT
26 
27 public:
28  UatDelegate(QObject *parent = 0);
29 
30  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
31  const QModelIndex &index) const;
32  void setEditorData(QWidget *editor, const QModelIndex &index) const;
33  void setModelData(QWidget *editor, QAbstractItemModel *model,
34  const QModelIndex &index) const;
35 
36 private slots:
37  void applyFilename(const QModelIndex& index);
38  void applyColor(const QModelIndex& index);
39 
40 private:
41  uat_field_t *indexToField(const QModelIndex &index) const;
42 };
43 #endif // UAT_DELEGATE_H
Definition: uat.h:226
Definition: pcapng.c:148
Definition: uat_delegate.h:23