Wireshark 4.7.0
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.
 

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
parentThe parent widget, defaults to 0.
edt_fixedPointer 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
indexThe 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)
overrideprotectedvirtual

Handles context menu events.

Parameters
eventThe context menu event.

◆ editProtocolPreference

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

Signal emitted to edit a specific protocol preference.

Parameters
prefPointer to the preference.
modulePointer 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_frameThe related frame number.
framenum_typeThe type of the related frame, defaults to FT_FRAMENUM_NONE.

◆ eventFilter()

bool ProtoTree::eventFilter ( QObject *  obj,
QEvent *  ev 
)
overrideprotectedvirtual

Filters events for watched objects.

Parameters
objThe watched object.
evThe 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
finfoPointer to the FieldInformation.

◆ focusInEvent()

void ProtoTree::focusInEvent ( QFocusEvent *  event)
overrideprotectedvirtual

Handles focus in events.

Parameters
eventThe focus event.

◆ goToHfid()

void ProtoTree::goToHfid ( int  hfid)

Navigates to a specific Header Field ID (HFID).

Parameters
hfidThe Header Field ID to navigate to.

◆ goToPacket

void ProtoTree::goToPacket ( int  packet_num)
signal

Signal emitted to jump to a specific packet.

Parameters
packet_numThe packet number to go to.

◆ itemClicked

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

Slot triggered when an item is clicked.

Parameters
indexThe model index of the clicked item.

◆ itemDoubleClicked

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

Slot triggered when an item is double-clicked.

Parameters
indexThe model index of the double-clicked item.

◆ keyReleaseEvent()

void ProtoTree::keyReleaseEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Handles key release events.

Parameters
eventThe key release event.

◆ moveCursor()

QModelIndex ProtoTree::moveCursor ( CursorAction  cursorAction,
Qt::KeyboardModifiers  modifiers 
)
overrideprotectedvirtual

Handles cursor movements within the tree.

Parameters
cursorActionThe cursor action type.
modifiersThe 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
openTrue 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_numThe related frame number.
typeThe type of the related frame.

◆ selectedFieldChanged

void ProtoTree::selectedFieldChanged ( FieldInformation finfo)
slot

Slot triggered when the selected field changes.

Parameters
finfoPointer to the new FieldInformation.

◆ selectedFrameChanged

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

Slot triggered when the selected frame changes.

Parameters
framesList of selected frame numbers.

◆ selectionChanged

void ProtoTree::selectionChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
overrideprotectedslot

Handles changes in the tree view selection.

Parameters
selectedThe newly selected items.
deselectedThe newly deselected items.

◆ setCaptureFile

void ProtoTree::setCaptureFile ( capture_file cf)
slot

Set the capture file.

Parameters
cfPointer to the capture file.

◆ setMonospaceFont

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

Sets the monospace font used in the tree view.

Parameters
mono_fontThe monospace font.

◆ setRootNode()

void ProtoTree::setRootNode ( proto_node root_node)

Sets the root protocol node to be displayed.

Parameters
root_nodePointer to the root proto_node.

◆ showProtocolPreferences

void ProtoTree::showProtocolPreferences ( const QString  module_name)
signal

Signal emitted to show preferences for a specific protocol.

Parameters
module_nameThe name of the protocol module.

◆ syncCollapsed

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

Synchronizes the collapsed state of a node.

Parameters
indexThe model index that was collapsed.

◆ syncExpanded

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

Synchronizes the expanded state of a node.

Parameters
indexThe model index that was expanded.

◆ timerEvent()

void ProtoTree::timerEvent ( QTimerEvent *  event)
overrideprotectedvirtual

Handles timer events.

Parameters
eventThe timer event.

◆ toString()

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

Converts the tree or a subtree to a string representation.

Parameters
start_idxThe 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
rootNodeThe starting root node index.
identLevelThe 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: