Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
drag_drop_toolbar.h
1 /* drag_drop_toolbar.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef DRAG_DROP_TOOLBAR_H
11 #define DRAG_DROP_TOOLBAR_H
12 
13 #include <QToolBar>
14 #include <QPoint>
15 
16 class DragDropToolBar : public QToolBar
17 {
18  Q_OBJECT
19 public:
20  explicit DragDropToolBar(const QString &title, QWidget *parent = Q_NULLPTR);
21  explicit DragDropToolBar(QWidget *parent = Q_NULLPTR);
22  ~DragDropToolBar();
23 
24  virtual void clear();
25 
26 Q_SIGNALS:
27  void actionMoved(QAction * action, int oldPos, int newPos);
28 
29  void newFilterDropped(QString description, QString filter);
30 
31 protected:
32 
33  virtual void childEvent(QChildEvent * event);
34 
35  virtual bool eventFilter(QObject * obj, QEvent * ev);
36  virtual void dragEnterEvent(QDragEnterEvent *event);
37  virtual void dragMoveEvent(QDragMoveEvent *event);
38  virtual void dropEvent(QDropEvent *event);
39 
40 private:
41 
42  QPoint dragStartPosition;
43  int childCounter;
44 
45  void setupToolbar();
46  void moveToolbarItems(int fromPos, int toPos);
47 
48 };
49 
50 #endif // DRAG_DROP_TOOLBAR_H
51 
52 /*
53  * Editor modelines
54  *
55  * Local Variables:
56  * c-basic-offset: 4
57  * tab-width: 8
58  * indent-tabs-mode: nil
59  * End:
60  *
61  * ex: set shiftwidth=4 tabstop=8 expandtab:
62  * :indentSize=4:tabSize=8:noTabs=true:
63  */
Definition: drag_drop_toolbar.h:16