From 8020be30fd46798aa61017f0ec936806d6495d07 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Tue, 27 Jun 2017 16:36:19 +0200 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- ui/qt/main_window.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ui/qt/main_window.cpp') 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 + #include #include #include @@ -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_); -- cgit v1.2.1