aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/widgets/packet_list_header.h
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2019-06-12 16:35:29 -0700
committerRoland Knall <rknall@gmail.com>2019-06-13 15:11:10 +0000
commit5ae259c4954a1894992b31de8661b0562ba87115 (patch)
tree86dc71c707be5e0523fc320d306aa5f0b2c7d284 /ui/qt/widgets/packet_list_header.h
parent36f99fd6f986a36ee3cef4acd90c9994cbad0b4e (diff)
Qt: Allow dropping fields to add columns and indicate width
Allows for dropping fields on the columns to add them as well as indicate width while dragging the columns Change-Id: Ic98ae431886e5eb2ebd9ba50390742995bf22d5a Reviewed-on: https://code.wireshark.org/review/33573 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/widgets/packet_list_header.h')
-rw-r--r--ui/qt/widgets/packet_list_header.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/ui/qt/widgets/packet_list_header.h b/ui/qt/widgets/packet_list_header.h
new file mode 100644
index 0000000000..d631579588
--- /dev/null
+++ b/ui/qt/widgets/packet_list_header.h
@@ -0,0 +1,50 @@
+/* packet_list_header.h
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef UI_QT_WIDGETS_PACKET_LIST_HEADER_H_
+#define UI_QT_WIDGETS_PACKET_LIST_HEADER_H_
+
+#include <QHeaderView>
+#include <QDrag>
+class QEvent;
+
+class PacketListHeader : public QHeaderView
+{
+public:
+ PacketListHeader(Qt::Orientation orientation, QWidget *parent = nullptr);
+
+protected:
+ virtual void dropEvent(QDropEvent *event) override;
+ virtual void dragEnterEvent(QDragEnterEvent *event) override;
+ virtual void dragMoveEvent(QDragMoveEvent *event) override;
+
+ virtual void mouseMoveEvent(QMouseEvent *e) override;
+ virtual void mousePressEvent(QMouseEvent *e) override;
+
+private:
+
+ int sectionIdx;
+ int lastSize;
+
+};
+
+#endif
+
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */