Wireshark 4.7.0
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:
FilterExpressionToolBar

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 WiresharkMimeDatacreateMimeData (QString name, int position)
 Creates MIME data for a specific toolbar item to support drag operations.
 
virtual void childEvent (QChildEvent *event)
 Handles child events, such as when widgets are added or removed.
 
virtual bool eventFilter (QObject *obj, QEvent *ev)
 Event filter used to intercept mouse events on toolbar child widgets for drag detection.
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 Handles drag enter events to accept valid drop targets.
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 Handles drag move events for visual feedback during drag operations.
 
virtual void dropEvent (QDropEvent *event)
 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
titleThe title of the toolbar.
parentThe parent widget, defaults to Q_NULLPTR.

◆ DragDropToolBar() [2/2]

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

Constructs a new DragDropToolBar.

Parameters
parentThe 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
actionPointer to the moved QAction.
oldPosThe original index position of the action.
newPosThe new index position of the action.

◆ childEvent()

void DragDropToolBar::childEvent ( QChildEvent *  event)
protectedvirtual

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

Parameters
eventThe child event details.

◆ createMimeData()

WiresharkMimeData * DragDropToolBar::createMimeData ( QString  name,
int  position 
)
protectedvirtual

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

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

Reimplemented in FilterExpressionToolBar.

◆ dragEnterEvent()

void DragDropToolBar::dragEnterEvent ( QDragEnterEvent *  event)
protectedvirtual

Handles drag enter events to accept valid drop targets.

Parameters
eventThe drag enter event details.

◆ dragMoveEvent()

void DragDropToolBar::dragMoveEvent ( QDragMoveEvent *  event)
protectedvirtual

Handles drag move events for visual feedback during drag operations.

Parameters
eventThe drag move event details.

◆ dropEvent()

void DragDropToolBar::dropEvent ( QDropEvent *  event)
protectedvirtual

Handles drop events to finalize reordering or add new items.

Parameters
eventThe drop event details.

◆ eventFilter()

bool DragDropToolBar::eventFilter ( QObject *  obj,
QEvent *  ev 
)
protectedvirtual

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

Parameters
objThe object receiving the event.
evThe 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
descriptionThe description of the dropped filter.
filterThe filter string itself.

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