Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
FilterExpressionToolBar Class Reference

A toolbar that displays filter expressions and supports drag-and-drop operations. More...

#include <filter_expression_toolbar.h>

Inheritance diagram for FilterExpressionToolBar:
DragDropToolBar

Public Slots

void filterExpressionsChanged ()
 Slot triggered when the underlying list of filter expressions changes.

Signals

void filterSelected (QString filter, bool apply)
 Signal emitted when a filter expression is selected.
void filterPreferences ()
 Signal emitted to open the filter preferences dialog.
void filterEdit (int uatIndex)
 Signal emitted to edit a filter expression at a specific index.
Signals inherited from DragDropToolBar
void actionMoved (QAction *action, int oldPos, int newPos)
 Signal emitted when an action has been moved via drag and drop.
void newFilterDropped (QString description, QString filter)
 Signal emitted when a new filter is dropped onto the toolbar.

Public Member Functions

 FilterExpressionToolBar (QWidget *parent=Q_NULLPTR)
 Constructs a new FilterExpressionToolBar.
Public Member Functions inherited from DragDropToolBar
 DragDropToolBar (const QString &title, QWidget *parent=Q_NULLPTR)
 Constructs a new DragDropToolBar with a specific title.
 DragDropToolBar (QWidget *parent=Q_NULLPTR)
 Constructs a new DragDropToolBar.
 ~DragDropToolBar ()
 Destroys the DragDropToolBar.
virtual void clear ()
 Clears all actions from the toolbar.

Protected Slots

void onCustomMenuHandler (const QPoint &pos)
 Handles custom context menu requests on the toolbar.
void onActionMoved (QAction *action, int oldPos, int newPos)
 Slot triggered when an action is dragged and moved within the toolbar.
void onFilterDropped (QString description, QString filter)
 Slot triggered when a filter is dropped onto the toolbar.

Protected Member Functions

virtual bool event (QEvent *event) override
 Handles events directed to the toolbar.
virtual bool eventFilter (QObject *obj, QEvent *ev) override
 Filters events for watched objects.
virtual WiresharkMimeDatacreateMimeData (QString name, int position) override
 Creates MIME data representing a dragged filter expression.
Protected Member Functions inherited from DragDropToolBar
virtual void childEvent (QChildEvent *event) override
 Handles child events, such as when widgets are added or removed.
virtual void dragEnterEvent (QDragEnterEvent *event) override
 Handles drag enter events to accept valid drop targets.
virtual void dragMoveEvent (QDragMoveEvent *event) override
 Handles drag move events for visual feedback during drag operations.
virtual void dropEvent (QDropEvent *event) override
 Handles drop events to finalize reordering or add new items.

Detailed Description

A toolbar that displays filter expressions and supports drag-and-drop operations.

Constructor & Destructor Documentation

◆ FilterExpressionToolBar()

FilterExpressionToolBar::FilterExpressionToolBar ( QWidget * parent = Q_NULLPTR)
explicit

Constructs a new FilterExpressionToolBar.

Parameters
parentThe parent widget, defaults to Q_NULLPTR.

Member Function Documentation

◆ createMimeData()

WiresharkMimeData * FilterExpressionToolBar::createMimeData ( QString name,
int position )
overrideprotectedvirtual

Creates MIME data representing a dragged filter expression.

Parameters
nameThe name of the dragged item.
positionThe position index of the item.
Returns
A pointer to the created WiresharkMimeData.

Reimplemented from DragDropToolBar.

◆ event()

bool FilterExpressionToolBar::event ( QEvent * event)
overrideprotectedvirtual

Handles events directed to the toolbar.

Parameters
eventThe event to process.
Returns
True if the event was handled, false otherwise.

◆ eventFilter()

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

Filters events for watched objects.

Parameters
objThe object being filtered.
evThe event to filter.
Returns
True if the event is filtered out, false otherwise.

Reimplemented from DragDropToolBar.

◆ filterEdit

void FilterExpressionToolBar::filterEdit ( int uatIndex)
signal

Signal emitted to edit a filter expression at a specific index.

Parameters
uatIndexThe UAT row index of the filter expression.

◆ filterSelected

void FilterExpressionToolBar::filterSelected ( QString filter,
bool apply )
signal

Signal emitted when a filter expression is selected.

Parameters
filterThe filter expression string.
applyTrue to apply the filter immediately, false to just prepare it.

◆ onActionMoved

void FilterExpressionToolBar::onActionMoved ( QAction * action,
int oldPos,
int newPos )
protectedslot

Slot triggered when an action is dragged and moved within the toolbar.

Parameters
actionThe action that was moved.
oldPosThe previous position index.
newPosThe new position index.

◆ onCustomMenuHandler

void FilterExpressionToolBar::onCustomMenuHandler ( const QPoint & pos)
protectedslot

Handles custom context menu requests on the toolbar.

Parameters
posThe position where the context menu was requested.

◆ onFilterDropped

void FilterExpressionToolBar::onFilterDropped ( QString description,
QString filter )
protectedslot

Slot triggered when a filter is dropped onto the toolbar.

Parameters
descriptionThe label/description of the dropped filter.
filterThe filter expression string.

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