summaryrefslogtreecommitdiff
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2017-06-27 16:36:19 +0200
committerRoland Knall <rknall@gmail.com>2017-06-28 15:09:03 +0000
commit8020be30fd46798aa61017f0ec936806d6495d07 (patch)
tree3066cad0abaaf66d537455e1ea35488c8ce76ae9 /ui/qt/main_window.cpp
parent9731b50bc501673a98b588be3ae6f43492ae3150 (diff)
downloadwireshark-8020be30fd46798aa61017f0ec936806d6495d07.tar.gz
Qt: Drag/Drop Filter buttons to order
Allow the ordering of the filter buttons via drag/drop in the toolbar Change-Id: Id8793d6514bae36066a7a23d6890985665e753bd Reviewed-on: https://code.wireshark.org/review/22422 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 5d7ac14741..fbbbcf58ba 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -84,6 +84,8 @@ DIAG_ON(frame-larger-than=)
#include "qt_ui_utils.h"
+#include <ui/qt/widgets/drag_drop_toolbar.h>
+
#include <QAction>
#include <QActionGroup>
#include <QDesktopWidget>
@@ -460,11 +462,13 @@ MainWindow::MainWindow(QWidget *parent) :
// Make sure filter expressions overflow into a menu instead of a
// larger toolbar. We do this by adding them to a child toolbar.
// https://bugreports.qt.io/browse/QTBUG-2472
- filter_expression_toolbar_ = new QToolBar();
+ filter_expression_toolbar_ = new DragDropToolBar();
filter_expression_toolbar_->setStyleSheet("QToolBar { background: none; border: none; }");
filter_expression_toolbar_->setContextMenuPolicy(Qt::CustomContextMenu);
connect(filter_expression_toolbar_, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(filterToolbarCustomMenuHandler(QPoint)));
+ connect(filter_expression_toolbar_, SIGNAL(actionMoved(QAction*, int, int)),
+ this, SLOT(filterToolbarActionMoved(QAction*, int, int)));
main_ui_->displayFilterToolBar->addWidget(filter_expression_toolbar_);