| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

A customized QToolBar that supports drag-and-drop reordering of its actions and handling external drops. More...

`#include <drag_drop_toolbar.h>`

Inheritance diagram for DragDropToolBar:

## Signals
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
| 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 Member Functions
virtual WiresharkMimeData * | createMimeData (QString name, int position)
| Creates MIME data for a specific toolbar item to support drag operations.
virtual void | childEvent (QChildEvent *event) override
| Handles child events, such as when widgets are added or removed.
virtual bool | eventFilter (QObject *obj, QEvent *ev) override
| Event filter used to intercept mouse events on toolbar child widgets for drag detection.
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 customized QToolBar that supports drag-and-drop reordering of its actions and handling external drops.

## Constructor & Destructor Documentation

## ◆ DragDropToolBar() [1/2]

DragDropToolBar::DragDropToolBar | ( | const QString & | title,
|  | QWidget * | parent = Q_NULLPTR )
| explicit

Constructs a new DragDropToolBar with a specific title.

Parameters

  title | The title of the toolbar.
  parent | The parent widget, defaults to Q_NULLPTR.

## ◆ DragDropToolBar() [2/2]

DragDropToolBar::DragDropToolBar | ( | QWidget * | parent = Q_NULLPTR | ) |
| explicit

Constructs a new DragDropToolBar.

Parameters

  parent | The parent widget, defaults to Q_NULLPTR.

## Member Function Documentation

## ◆ actionMoved

void DragDropToolBar::actionMoved | ( | QAction * | action,
|  | int | oldPos,
|  | int | newPos )
| signal

Signal emitted when an action has been moved via drag and drop.

Parameters

  action | Pointer to the moved QAction.
  oldPos | The original index position of the action.
  newPos | The new index position of the action.

## ◆ childEvent()

void DragDropToolBar::childEvent | ( | QChildEvent * | event | ) |
| override protected virtual

Handles child events, such as when widgets are added or removed.

Parameters

  event | The child event details.

## ◆ createMimeData()

WiresharkMimeData * DragDropToolBar::createMimeData | ( | QString | name,
|  | int | position )
| protected virtual

Creates MIME data for a specific toolbar item to support drag operations.

Parameters

  name | The name or description of the item.
  position | The current position index of the item.

Returns
  A pointer to the created WiresharkMimeData.

Reimplemented in FilterExpressionToolBar.

## ◆ dragEnterEvent()

void DragDropToolBar::dragEnterEvent | ( | QDragEnterEvent * | event | ) |
| override protected virtual

Handles drag enter events to accept valid drop targets.

Parameters

  event | The drag enter event details.

## ◆ dragMoveEvent()

void DragDropToolBar::dragMoveEvent | ( | QDragMoveEvent * | event | ) |
| override protected virtual

Handles drag move events for visual feedback during drag operations.

Parameters

  event | The drag move event details.

## ◆ dropEvent()

void DragDropToolBar::dropEvent | ( | QDropEvent * | event | ) |
| override protected virtual

Handles drop events to finalize reordering or add new items.

Parameters

  event | The drop event details.

## ◆ eventFilter()

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

Event filter used to intercept mouse events on toolbar child widgets for drag detection.

Parameters

  obj | The object receiving the event.
  ev | The event being intercepted.

Returns
  True if the event was filtered out, false otherwise.

Reimplemented in FilterExpressionToolBar.

## ◆ newFilterDropped

void DragDropToolBar::newFilterDropped | ( | QString | description,
|  | QString | filter )
| signal

Signal emitted when a new filter is dropped onto the toolbar.

Parameters

  description | The description of the dropped filter.
  filter | The filter string itself.

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

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