Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
decode_as_delegate.h
Go to the documentation of this file.
1
12#ifndef DECODE_AS_DELEGATE_H
13#define DECODE_AS_DELEGATE_H
14
15#include <config.h>
16
17#include <epan/cfile.h>
18
19#include <QStyledItemDelegate>
20#include <QSet>
21#include <QList>
23
32
33
37class DecodeAsDelegate : public QStyledItemDelegate
38{
39public:
46 DecodeAsDelegate(QObject *parent = 0, capture_file *cf = NULL);
47
60 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
61 const QModelIndex &index) const override;
62
72 void destroyEditor(QWidget *editor, const QModelIndex &index) const override;
73
83 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
84
95 void setModelData(QWidget *editor, QAbstractItemModel *model,
96 const QModelIndex &index) const override;
97
98#if 0
99 void updateEditorGeometry(QWidget *editor,
100 const QStyleOptionViewItem &option, const QModelIndex &index) const;
101#endif
102
103private:
110 DecodeAsItem *indexToField(const QModelIndex &index) const;
111
119 void collectDAProtocols(QSet<QString> &all_protocols,
120 QList<QString> &current_list) const;
121
125 void cachePacketProtocols();
126
133 bool isSelectorCombo(DecodeAsItem *item) const;
134
135
145 static void decodeAddProtocol(const char *table_name, const char *proto_name,
146 void *value, void *user_data);
147
148 capture_file *cap_file_;
149 QList<packet_proto_data_t> packet_proto_list_;
150};
151#endif // DECODE_AS_DELEGATE_H
Item delegate providing in-place editors for the Decode As table.
Definition decode_as_delegate.h:38
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Create an editor widget for the cell at index.
Definition decode_as_delegate.cpp:140
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populate the editor with the current model data.
Definition decode_as_delegate.cpp:317
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Write the editor's current value back to the model.
Definition decode_as_delegate.cpp:347
void destroyEditor(QWidget *editor, const QModelIndex &index) const override
Destroy the editor widget created by createEditor().
Definition decode_as_delegate.cpp:306
Represents a single "Decode As" mapping entry in the UI.
Definition decode_as_model.h:30
struct _packet_proto_data_t packet_proto_data_t
Per-layer protocol data collected from the currently selected packet.
Represents a capture file and its associated metadata.
Definition cfile.h:84
Per-layer protocol data collected from the currently selected packet.
Definition decode_as_delegate.h:27
uint8_t curr_layer_num
Definition decode_as_delegate.h:30
const char * proto_name
Definition decode_as_delegate.h:28
const char * table_ui_name
Definition decode_as_delegate.h:29