| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | List of all members
ProtoTree Class Reference

A tree view for displaying protocol dissection details. More...

`#include <proto_tree.h>`

Inheritance diagram for ProtoTree:

## Public Slots
void | setCaptureFile (capture_file *cf)
| Set the capture file.
void | setMonospaceFont (const QFont &mono_font)
| Sets the monospace font used in the tree view.
void | syncExpanded (const QModelIndex &index)
| Synchronizes the expanded state of a node.
void | syncCollapsed (const QModelIndex &index)
| Synchronizes the collapsed state of a node.
void | expandSubtrees ()
| Expands all subtrees of the currently selected item.
void | collapseSubtrees ()
| Collapses all subtrees of the currently selected item.
void | expandAll ()
| Expands all items in the tree.
void | collapseAll ()
| Collapses all items in the tree.
void | itemClicked (const QModelIndex &index)
| Slot triggered when an item is clicked.
void | itemDoubleClicked (const QModelIndex &index)
| Slot triggered when an item is double-clicked.
void | selectedFieldChanged (FieldInformation *finfo)
| Slot triggered when the selected field changes.
void | selectedFrameChanged (QList< int > frames)
| Slot triggered when the selected frame changes.

## Signals
void | fieldSelected (FieldInformation *finfo)
| Signal emitted when a field is selected.
void | openPacketInNewWindow (bool open)
| Signal emitted to open the packet in a new window.
void | goToPacket (int packet_num)
| Signal emitted to jump to a specific packet.
void | relatedFrame (int frame_num, ft_framenum_type_t type)
| Signal emitted to indicate a related frame.
void | showProtocolPreferences (const QString module_name)
| Signal emitted to show preferences for a specific protocol.
void | editProtocolPreference (pref_t *pref, module_t *module)
| Signal emitted to edit a specific protocol preference.
void | recolorPacketsRequested ()
| Signal emitted to request packet recolorization.
void | redissectPacketsRequested ()
| Signal emitted to request redissection of packets.
void | showDistributionDialog (const QString abbr_name)
| Signal emitted to show a Distribution Dialog for a Named Field.

## Public Member Functions
| ProtoTree (QWidget *parent=0, epan_dissect_t *edt_fixed=0)
| Constructs a new ProtoTree.
QMenu * | colorizeMenu ()
| Retrieves the colorize menu.
void | setRootNode (proto_node *root_node)
| Sets the root protocol node to be displayed.
void | emitRelatedFrame (int related_frame, ft_framenum_type_t framenum_type=FT_FRAMENUM_NONE)
| Emits a signal indicating a related frame.
void | autoScrollTo (const QModelIndex &index)
| Automatically scrolls to a specific model index.
void | goToHfid (int hfid)
| Navigates to a specific Header Field ID (HFID).
void | clear ()
| Clears the protocol tree.
void | restoreSelectedField ()
| Restores the previously selected field in the tree.
QString | toString (const QModelIndex &start_idx=QModelIndex()) const
| Converts the tree or a subtree to a string representation.

## Protected Types
enum | { Name = 0 , Description , Value }
| Columns in the protocol tree. More...

## Protected Slots
void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override
| Handles changes in the tree view selection.
void | ctxCopyVisibleItems ()
| Context menu action to copy all visible items.
void | ctxCopyAsFilter ()
| Context menu action to copy the selected item as a display filter.
void | ctxCopySelectedInfo ()
| Context menu action to copy the selected information.
void | ctxOpenUrlWiki ()
| Context menu action to open the associated protocol wiki page.

## Protected Member Functions
virtual void | contextMenuEvent (QContextMenuEvent *event) override
| Handles context menu events.
virtual void | timerEvent (QTimerEvent *event) override
| Handles timer events.
virtual void | keyReleaseEvent (QKeyEvent *event) override
| Handles key release events.
virtual void | focusInEvent (QFocusEvent *event) override
| Handles focus in events.
virtual bool | eventFilter (QObject *obj, QEvent *ev) override
| Filters events for watched objects.
virtual QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override
| Handles cursor movements within the tree.
QString | traverseTree (const QModelIndex &rootNode, int identLevel=0) const
| Traverses the tree and builds a string representation.

## Detailed Description

A tree view for displaying protocol dissection details.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum
| protected

Columns in the protocol tree.

Enumerator
Name | The name column.
Description | The description column.
Value | The value column.

## Constructor & Destructor Documentation

## ◆ ProtoTree()

ProtoTree::ProtoTree | ( | QWidget * | parent = 0,
|  | epan_dissect_t * | edt_fixed = 0 )
| explicit

Constructs a new ProtoTree.

Parameters

  parent | The parent widget, defaults to 0.
  edt_fixed | Pointer to fixed epan dissection data, defaults to 0.

## Member Function Documentation

## ◆ autoScrollTo()

void ProtoTree::autoScrollTo | ( | const QModelIndex & | index | ) |

Automatically scrolls to a specific model index.

Parameters

  index | The model index to scroll to.

## ◆ colorizeMenu()

QMenu * ProtoTree::colorizeMenu | ( |  | ) |
| inline

Retrieves the colorize menu.

Returns
  A pointer to the colorize QMenu.

## ◆ contextMenuEvent()

void ProtoTree::contextMenuEvent | ( | QContextMenuEvent * | event | ) |
| override protected virtual

Handles context menu events.

Parameters

  event | The context menu event.

## ◆ editProtocolPreference

void ProtoTree::editProtocolPreference | ( | pref_t * | pref,
|  | module_t * | module )
| signal

Signal emitted to edit a specific protocol preference.

Parameters

  pref | Pointer to the preference.
  module | Pointer to the module.

## ◆ emitRelatedFrame()

void ProtoTree::emitRelatedFrame | ( | int | related_frame,
|  | ft_framenum_type_t | framenum_type = FT_FRAMENUM_NONE )

Emits a signal indicating a related frame.

Parameters

  related_frame | The related frame number.
  framenum_type | The type of the related frame, defaults to FT_FRAMENUM_NONE.

## ◆ eventFilter()

bool ProtoTree::eventFilter | ( | QObject * | obj,
|  | QEvent * | ev )
| override protected virtual

Filters events for watched objects.

Parameters

  obj | The watched object.
  ev | The event to filter.

Returns
  True if the event was filtered, false otherwise.

## ◆ fieldSelected

void ProtoTree::fieldSelected | ( | FieldInformation * | finfo | ) |
| signal

Signal emitted when a field is selected.

Parameters

  finfo | Pointer to the FieldInformation.

## ◆ focusInEvent()

void ProtoTree::focusInEvent | ( | QFocusEvent * | event | ) |
| override protected virtual

Handles focus in events.

Parameters

  event | The focus event.

## ◆ goToHfid()

void ProtoTree::goToHfid | ( | int | hfid | ) |

Navigates to a specific Header Field ID (HFID).

Parameters

  hfid | The Header Field ID to navigate to.

## ◆ goToPacket

void ProtoTree::goToPacket | ( | int | packet_num | ) |
| signal

Signal emitted to jump to a specific packet.

Parameters

  packet_num | The packet number to go to.

## ◆ itemClicked

void ProtoTree::itemClicked | ( | const QModelIndex & | index | ) |
| slot

Slot triggered when an item is clicked.

Parameters

  index | The model index of the clicked item.

## ◆ itemDoubleClicked

void ProtoTree::itemDoubleClicked | ( | const QModelIndex & | index | ) |
| slot

Slot triggered when an item is double-clicked.

Parameters

  index | The model index of the double-clicked item.

## ◆ keyReleaseEvent()

void ProtoTree::keyReleaseEvent | ( | QKeyEvent * | event | ) |
| override protected virtual

Handles key release events.

Parameters

  event | The key release event.

## ◆ moveCursor()

QModelIndex ProtoTree::moveCursor | ( | CursorAction | cursorAction,
|  | Qt::KeyboardModifiers | modifiers )
| override protected virtual

Handles cursor movements within the tree.

Parameters

  cursorAction | The cursor action type.
  modifiers | The keyboard modifiers.

Returns
  The new model index after moving the cursor.

## ◆ openPacketInNewWindow

void ProtoTree::openPacketInNewWindow | ( | bool | open | ) |
| signal

Signal emitted to open the packet in a new window.

Parameters

  open | True to open in a new window.

## ◆ relatedFrame

void ProtoTree::relatedFrame | ( | int | frame_num,
|  | ft_framenum_type_t | type )
| signal

Signal emitted to indicate a related frame.

Parameters

  frame_num | The related frame number.
  type | The type of the related frame.

## ◆ selectedFieldChanged

void ProtoTree::selectedFieldChanged | ( | FieldInformation * | finfo | ) |
| slot

Slot triggered when the selected field changes.

Parameters

  finfo | Pointer to the new FieldInformation.

## ◆ selectedFrameChanged

void ProtoTree::selectedFrameChanged | ( | QList< int > | frames | ) |
| slot

Slot triggered when the selected frame changes.

Parameters

  frames | List of selected frame numbers.

## ◆ selectionChanged

void ProtoTree::selectionChanged | ( | const QItemSelection & | selected,
|  | const QItemSelection & | deselected )
| override protected slot

Handles changes in the tree view selection.

Parameters

  selected | The newly selected items.
  deselected | The newly deselected items.

## ◆ setCaptureFile

void ProtoTree::setCaptureFile | ( | capture_file * | cf | ) |
| slot

Set the capture file.

Parameters

  cf | Pointer to the capture file.

## ◆ setMonospaceFont

void ProtoTree::setMonospaceFont | ( | const QFont & | mono_font | ) |
| slot

Sets the monospace font used in the tree view.

Parameters

  mono_font | The monospace font.

## ◆ setRootNode()

void ProtoTree::setRootNode | ( | proto_node * | root_node | ) |

Sets the root protocol node to be displayed.

Parameters

  root_node | Pointer to the root proto_node.

## ◆ showDistributionDialog

void ProtoTree::showDistributionDialog | ( | const QString | abbr_name | ) |
| signal

Signal emitted to show a Distribution Dialog for a Named Field.

Parameters

  abbr_name | The name of the Named Field.

## ◆ showProtocolPreferences

void ProtoTree::showProtocolPreferences | ( | const QString | module_name | ) |
| signal

Signal emitted to show preferences for a specific protocol.

Parameters

  module_name | The name of the protocol module.

## ◆ syncCollapsed

void ProtoTree::syncCollapsed | ( | const QModelIndex & | index | ) |
| slot

Synchronizes the collapsed state of a node.

Parameters

  index | The model index that was collapsed.

## ◆ syncExpanded

void ProtoTree::syncExpanded | ( | const QModelIndex & | index | ) |
| slot

Synchronizes the expanded state of a node.

Parameters

  index | The model index that was expanded.

## ◆ timerEvent()

void ProtoTree::timerEvent | ( | QTimerEvent * | event | ) |
| override protected virtual

Handles timer events.

Parameters

  event | The timer event.

## ◆ toString()

QString ProtoTree::toString | ( | const QModelIndex & | start_idx = QModelIndex() | ) | const

Converts the tree or a subtree to a string representation.

Parameters

  start_idx | The starting model index, defaults to QModelIndex().

Returns
  The string representation of the tree.

## ◆ traverseTree()

QString ProtoTree::traverseTree | ( | const QModelIndex & | rootNode,
|  | int | identLevel = 0 ) const
| protected

Traverses the tree and builds a string representation.

Parameters

  rootNode | The starting root node index.
  identLevel | The current indentation level, defaults to 0.

Returns
  The string representation of the traversed subtree.

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

- /builds/wireshark/wireshark/ui/qt/proto_tree.h
- /builds/wireshark/wireshark/ui/qt/proto_tree.cpp