Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DecodeAsDelegate Class Reference

Item delegate providing in-place editors for the Decode As table. More...

#include <decode_as_delegate.h>

Inheritance diagram for DecodeAsDelegate:

Public Member Functions

 DecodeAsDelegate (QObject *parent=0, capture_file *cf=NULL)
 Construct a DecodeAsDelegate.
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Create an editor widget for the cell at index.
 
void destroyEditor (QWidget *editor, const QModelIndex &index) const override
 Destroy the editor widget created by createEditor().
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Populate the editor with the current model data.
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Write the editor's current value back to the model.
 

Detailed Description

Item delegate providing in-place editors for the Decode As table.

Constructor & Destructor Documentation

◆ DecodeAsDelegate()

DecodeAsDelegate::DecodeAsDelegate ( QObject *  parent = 0,
capture_file cf = NULL 
)

Construct a DecodeAsDelegate.

Parameters
parentThe parent QObject.
cfThe currently open capture file, used to interrogate the selected packet for its protocol layers. May be NULL.

Member Function Documentation

◆ createEditor()

QWidget * DecodeAsDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Create an editor widget for the cell at index.

Returns a QComboBox populated with dissector table selector values (for the selector column) or dissector handle names (for the codec column). Falls back to QStyledItemDelegate for other columns.

Parameters
parentThe parent widget for the editor.
optionStyle options for the editor's viewport rect.
indexThe model index of the cell being edited.
Returns
The editor widget; ownership is transferred to the view.

◆ destroyEditor()

void DecodeAsDelegate::destroyEditor ( QWidget *  editor,
const QModelIndex &  index 
) const
override

Destroy the editor widget created by createEditor().

Performs any cleanup required before the editor is deleted, then delegates to QStyledItemDelegate::destroyEditor().

Parameters
editorThe editor widget to destroy.
indexThe model index the editor was associated with.

◆ setEditorData()

void DecodeAsDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
override

Populate the editor with the current model data.

Sets the current selection of the selector or dissector combo box to match the value stored at index in the model.

Parameters
editorThe editor widget returned by createEditor().
indexThe model index whose data should be loaded.

◆ setModelData()

void DecodeAsDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const
override

Write the editor's current value back to the model.

Reads the selected item from the selector or dissector combo box and stores it into model at index.

Parameters
editorThe editor widget whose value should be committed.
modelThe model to update.
indexThe model index to write to.

The documentation for this class was generated from the following files: