Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
drag_drop_toolbar.h
Go to the documentation of this file.
1
10#ifndef DRAG_DROP_TOOLBAR_H
11#define DRAG_DROP_TOOLBAR_H
12
13#include <QToolBar>
14#include <QPoint>
15
17
21class DragDropToolBar : public QToolBar
22{
23 Q_OBJECT
24public:
30 explicit DragDropToolBar(const QString &title, QWidget *parent = Q_NULLPTR);
31
36 explicit DragDropToolBar(QWidget *parent = Q_NULLPTR);
37
42
46 virtual void clear();
47
48signals:
55 void actionMoved(QAction * action, int oldPos, int newPos);
56
62 void newFilterDropped(QString description, QString filter);
63
64protected:
65
72 virtual WiresharkMimeData * createMimeData(QString name, int position);
73
78 virtual void childEvent(QChildEvent * event);
79
86 virtual bool eventFilter(QObject * obj, QEvent * ev);
87
92 virtual void dragEnterEvent(QDragEnterEvent *event);
93
98 virtual void dragMoveEvent(QDragMoveEvent *event);
99
104 virtual void dropEvent(QDropEvent *event);
105
106private:
107
109 QPoint dragStartPosition;
110
112 int childCounter;
113
117 void setupToolbar();
118
124 void moveToolbarItems(int fromPos, int toPos);
125
126};
127
128#endif // DRAG_DROP_TOOLBAR_H
A customized QToolBar that supports drag-and-drop reordering of its actions and handling external dro...
Definition drag_drop_toolbar.h:22
virtual void dragMoveEvent(QDragMoveEvent *event)
Handles drag move events for visual feedback during drag operations.
Definition drag_drop_toolbar.cpp:175
virtual void dropEvent(QDropEvent *event)
Handles drop events to finalize reordering or add new items.
Definition drag_drop_toolbar.cpp:221
void newFilterDropped(QString description, QString filter)
Signal emitted when a new filter is dropped onto the toolbar.
virtual bool eventFilter(QObject *obj, QEvent *ev)
Event filter used to intercept mouse events on toolbar child widgets for drag detection.
Definition drag_drop_toolbar.cpp:103
virtual WiresharkMimeData * createMimeData(QString name, int position)
Creates MIME data for a specific toolbar item to support drag operations.
Definition drag_drop_toolbar.cpp:98
virtual void dragEnterEvent(QDragEnterEvent *event)
Handles drag enter events to accept valid drop targets.
Definition drag_drop_toolbar.cpp:149
virtual void clear()
Clears all actions from the toolbar.
Definition drag_drop_toolbar.cpp:92
virtual void childEvent(QChildEvent *event)
Handles child events, such as when widgets are added or removed.
Definition drag_drop_toolbar.cpp:61
void actionMoved(QAction *action, int oldPos, int newPos)
Signal emitted when an action has been moved via drag and drop.
~DragDropToolBar()
Destroys the DragDropToolBar.
Definition drag_drop_toolbar.cpp:57
Base class for Wireshark specific MIME data.
Definition wireshark_mime_data.h:18