From e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 22:34:10 +0200 Subject: Adding upstream version 4.2.2. Signed-off-by: Daniel Baumann --- ui/qt/widgets/drag_drop_toolbar.h | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ui/qt/widgets/drag_drop_toolbar.h (limited to 'ui/qt/widgets/drag_drop_toolbar.h') diff --git a/ui/qt/widgets/drag_drop_toolbar.h b/ui/qt/widgets/drag_drop_toolbar.h new file mode 100644 index 00000000..c2937d0f --- /dev/null +++ b/ui/qt/widgets/drag_drop_toolbar.h @@ -0,0 +1,54 @@ +/** @file + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef DRAG_DROP_TOOLBAR_H +#define DRAG_DROP_TOOLBAR_H + +#include +#include + +class WiresharkMimeData; + +class DragDropToolBar : public QToolBar +{ + Q_OBJECT +public: + explicit DragDropToolBar(const QString &title, QWidget *parent = Q_NULLPTR); + explicit DragDropToolBar(QWidget *parent = Q_NULLPTR); + ~DragDropToolBar(); + + virtual void clear(); + +signals: + void actionMoved(QAction * action, int oldPos, int newPos); + + void newFilterDropped(QString description, QString filter); + +protected: + + virtual WiresharkMimeData * createMimeData(QString name, int position); + + virtual void childEvent(QChildEvent * event); + + virtual bool eventFilter(QObject * obj, QEvent * ev); + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dragMoveEvent(QDragMoveEvent *event); + virtual void dropEvent(QDropEvent *event); + +private: + + QPoint dragStartPosition; + int childCounter; + + void setupToolbar(); + void moveToolbarItems(int fromPos, int toPos); + +}; + +#endif // DRAG_DROP_TOOLBAR_H -- cgit v1.2.3