| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

A QTabWidget class, providing tap information. More...

`#include <traffic_tab.h>`

Inheritance diagram for TrafficTab:

## Public Slots
void | useAbsoluteTime (bool absolute)
| Use absolute time for the time columns.
void | limitToDisplayFilter (bool limit)
| Limits the displayed data to the active display filter.
void | setMachineReadable (bool machine)
| Configures output presentation to be machine readable.
void | setOpenTabs (QList< int > protocols)
| Opens specific protocol tabs based on a list.

## Signals
void | filterAction (QString filter, FilterAction::Action action, FilterAction::ActionType type)
| Signal emitted to trigger a filter action.
void | tabDataChanged (int idx, int selcounter)
| Signal emitted when the tab data has changed.
void | retapRequired ()
| Signal emitted when a retap operation is required.
void | disablingTaps ()
| Signal emitted to notify that taps are being disabled.
void | tabsChanged (QList< int > protocols)
| Signal emitted when the open tabs have changed.
void | columnsHaveChanged (QList< int > columns)
| Signal emitted when the column configuration has changed.

## Public Member Functions
| TrafficTab (QWidget *parent=nullptr)
| Constructs a new TrafficTab widget.
virtual | ~TrafficTab ()
| Destroys the TrafficTab widget.
void | setProtocolInfo (QString tableName, TrafficTypesList *trafficList, GList **recentList, GList **recentColumnList, ATapModelCallback createModel)
| Set the Protocol Info for the traffic tab.
void | setDelegate (ATapCreateDelegate createDelegate)
| Set the Delegate object for the tab. It will apply for all models residing in this tab object.
void | setFilter (QString filter=QString())
| Set the filter or remove it by providing an empty filter.
void | setNameResolution (bool checked)
| Enable/Disable name resolution for the address column.
void | disableTap ()
| Disables the taps for this traffic tab.
QMenu * | createCopyMenu (QWidget *parent=nullptr)
| Create a menu containing clipboard copy entries for this tab.
bool | hasNameResolution (int tabIdx=-1)
| Checks, wether the given tabpage support name resolution on the address column.
QVariant | currentItemData (int role=Qt::DisplayRole)
| Return the itemData for the currently selected index in the currently displayed treeview.
qlonglong | countSelectedItems (int role=Qt::DisplayRole)
| Return the number of currently selected items in the currently displayed treeview.
QList< QList< QVariant > > | selectedItemsIOGData ()
| Return a list of IOGraph related data, for the currently selected index or indexes in the currently displayed treeview.
void | useNanosecondTimestamps (bool useNSTime)
| Use nanosecond timestamps if requested.
ATapDataModel * | dataModelForTabIndex (int tabIdx=-1)
| Retrieves the tap data model for a specific tab index.
Public Member Functions inherited from DetachableTabWidget
| DetachableTabWidget (QWidget *parent=nullptr)
| Constructs a new DetachableTabWidget.
QString | tabBasename () const
| Retrieves the base name used when generating detached tab titles.

## Protected Slots
virtual void | detachTab (int idx, QPoint pos) override
| Slot called to detach a tab into its own window.
virtual void | attachTab (QWidget *content, QString name) override
| Slot called to reattach a previously detached tab.
Protected Slots inherited from DetachableTabWidget
virtual void | moveTab (int from, int to)
| Moves a tab from one index to another.
virtual void | detachTab (int tabIdx, QPoint pos)
| Detaches a tab into its own separate dialog window.
virtual void | attachTab (QWidget *content, QString name)
| Attaches a previously detached widget back into the tab widget.

## Additional Inherited Members
Protected Member Functions inherited from DetachableTabWidget
void | setTabBasename (QString newName)
| Sets the base name used when generating detached tab titles.

## Detailed Description

A QTabWidget class, providing tap information.

This class combines all required information, to display tapped data to the user. Specifically it handles all model data internally, therefore removing the need of the dialog to know how data is being stored or generated.

## Constructor & Destructor Documentation

## ◆ TrafficTab()

TrafficTab::TrafficTab | ( | QWidget * | parent = nullptr | ) |

Constructs a new TrafficTab widget.

Parameters

  parent | The parent widget.

## Member Function Documentation

## ◆ attachTab

void TrafficTab::attachTab | ( | QWidget * | content,
|  | QString | name )
| override protected virtual slot

Slot called to reattach a previously detached tab.

Parameters

  content | The widget content to reattach.
  name | The name of the tab.

## ◆ columnsHaveChanged

void TrafficTab::columnsHaveChanged | ( | QList< int > | columns | ) |
| signal

Signal emitted when the column configuration has changed.

Parameters

  columns | List of active columns.

## ◆ countSelectedItems()

qlonglong TrafficTab::countSelectedItems | ( | int | role = Qt::DisplayRole | ) |

Return the number of currently selected items in the currently displayed treeview.

Parameters

  role | the role to be used, defaults to Qt::DisplayRole

Returns
  qlonglong the number of selected items

## ◆ createCopyMenu()

QMenu * TrafficTab::createCopyMenu | ( | QWidget * | parent = nullptr | ) |

Create a menu containing clipboard copy entries for this tab.

It will create all entries, including copying the content of the currently selected tab to CSV, YAML and JSON

Parameters

  parent | the parent object or null

Returns
  QMenu* the resulting menu or null

## ◆ currentItemData()

QVariant TrafficTab::currentItemData | ( | int | role = Qt::DisplayRole | ) |

Return the itemData for the currently selected index in the currently displayed treeview.

Parameters

  role | the role to be used, defaults to Qt::DisplayRole

Returns
  QVariant the resulting value as QVariant type

## ◆ dataModelForTabIndex()

ATapDataModel * TrafficTab::dataModelForTabIndex | ( | int | tabIdx = -1 | ) |

Retrieves the tap data model for a specific tab index.

Parameters

  tabIdx | The tab index, or current index if -1.

Returns
  Pointer to the ATapDataModel.

## ◆ detachTab

void TrafficTab::detachTab | ( | int | idx,
|  | QPoint | pos )
| override protected virtual slot

Slot called to detach a tab into its own window.

Parameters

  idx | The index of the tab to detach.
  pos | The position to place the new window.

## ◆ disableTap()

void TrafficTab::disableTap | ( |  | ) |

Disables the taps for this traffic tab.

Disables all taps for models used by this traffic tab. They cannot be re-enabled on purpose, as in most cases, disabling them is being done during closing of the original capture file. This also disabled all filter actions, as well as the tap selection button.

## ◆ filterAction

void TrafficTab::filterAction | ( | QString | filter,
|  | FilterAction::Action | action,
|  | FilterAction::ActionType | type )
| signal

Signal emitted to trigger a filter action.

Parameters

  filter | The filter string.
  action | The specific action to take.
  type | The type of the filter action.

## ◆ hasNameResolution()

bool TrafficTab::hasNameResolution | ( | int | tabIdx = -1 | ) |

Checks, wether the given tabpage support name resolution on the address column.

Parameters

  tabIdx | the index of the page. If it is out of bounds or < 0, the current index is being used

Returns
  true if name resolution is being supported
  false if name resolution is not supported

## ◆ limitToDisplayFilter

void TrafficTab::limitToDisplayFilter | ( | bool | limit | ) |
| slot

Limits the displayed data to the active display filter.

Parameters

  limit | True to apply the display filter constraint.

## ◆ selectedItemsIOGData()

QList< QList< QVariant > > TrafficTab::selectedItemsIOGData | ( |  | ) |

Return a list of IOGraph related data, for the currently selected index or indexes in the currently displayed treeview.

Returns
  QList of IOGraph related data expressed in QVariant types

## ◆ setDelegate()

void TrafficTab::setDelegate | ( | ATapCreateDelegate | createDelegate | ) |

Set the Delegate object for the tab. It will apply for all models residing in this tab object.

Parameters

  createDelegate | the callback for the delegate creation

See also
  ATapCreateDelegate

## ◆ setFilter()

void TrafficTab::setFilter | ( | QString | filter = QString() | ) |

Set the filter or remove it by providing an empty filter.

This differs from filtering the model itself in such a way, that filtering is being done using the epan system. Therefore, once filtered, the only way to get all elements back is to set an empty string.

Note
  Filtering will only work, as long as the capture file remains open. If taps have been disabled and capture has stopped, filtering will no longer work.

Parameters

  filter | the string to be filtered on

## ◆ setMachineReadable

void TrafficTab::setMachineReadable | ( | bool | machine | ) |
| slot

Configures output presentation to be machine readable.

Parameters

  machine | True to enable machine readable formatting.

## ◆ setNameResolution()

void TrafficTab::setNameResolution | ( | bool | checked | ) |

Enable/Disable name resolution for the address column.

Parameters

  checked | true to enable name resolution

## ◆ setOpenTabs

void TrafficTab::setOpenTabs | ( | QList< int > | protocols | ) |
| slot

Opens specific protocol tabs based on a list.

Parameters

  protocols | List of protocol IDs to open tabs for.

## ◆ setProtocolInfo()

void TrafficTab::setProtocolInfo | ( | QString | tableName,
|  | TrafficTypesList * | trafficList,
|  | GList ** | recentList,
|  | GList ** | recentColumnList,
|  | ATapModelCallback | createModel )

Set the Protocol Info for the traffic tab.

This has to be called right after instantiating the class. The reason this is not done inside the constructor is such, that the object can be used with Qt Designer without having to removing the predefined object during setup of the UI.

Parameters

  tableName | The name for the table. Used for the protocol selection button
  trafficList | an element of traffictypeslist, which handles all profile selections
  recentColumnList | a list of columns to be displayed for this traffic type
  createModel | A callback, which will create the correct model for the trees

See also
  ATapModelCallback

## ◆ tabDataChanged

void TrafficTab::tabDataChanged | ( | int | idx,
|  | int | selcounter )
| signal

Signal emitted when the tab data has changed.

Parameters

  idx | The tab index.
  selcounter | The count of selected items.

## ◆ tabsChanged

void TrafficTab::tabsChanged | ( | QList< int > | protocols | ) |
| signal

Signal emitted when the open tabs have changed.

Parameters

  protocols | List of protocol IDs currently open.

## ◆ useAbsoluteTime

void TrafficTab::useAbsoluteTime | ( | bool | absolute | ) |
| slot

Use absolute time for the time columns.

Parameters

  absolute | true if absolute time should be used

## ◆ useNanosecondTimestamps()

void TrafficTab::useNanosecondTimestamps | ( | bool | useNSTime | ) |

Use nanosecond timestamps if requested.

Parameters

  useNSTime | use nanosecond timestamps if required and requested

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

- /builds/wireshark/wireshark/ui/qt/widgets/traffic_tab.h
- /builds/wireshark/wireshark/ui/qt/widgets/traffic_tab.cpp