From afb7b42360991f38fda3962eb6899562a2d75d6d Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Sat, 28 Nov 2015 00:06:56 +0100 Subject: Qt: fix "go to packet" broken by g56625dd Keeping auto scroll is required to update the row displayed. Instead catch the mouse event and stop auto scroll only during that time. Change-Id: Ibc5b0a4115192fc3e01e63c82e67761e5aed9d3b Reviewed-on: https://code.wireshark.org/review/12235 Reviewed-by: Pascal Quantin (cherry picked from commit df83e45084f7a8430225f646a03d1974b188d3ca) Reviewed-on: https://code.wireshark.org/review/12241 --- ui/qt/packet_list.cpp | 8 +++++++- ui/qt/packet_list.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 3b39b00c60..a2f565505d 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -260,7 +260,6 @@ PacketList::PacketList(QWidget *parent) : setRootIsDecorated(false); setSortingEnabled(true); setUniformRowHeights(true); - setAutoScroll(false); setAccessibleName("Packet list"); overlay_sb_ = new OverlayScrollBar(Qt::Vertical, this); @@ -559,6 +558,13 @@ void PacketList::paintEvent(QPaintEvent *event) QTreeView::paintEvent(event); } +void PacketList::mousePressEvent (QMouseEvent *event) +{ + setAutoScroll(false); + QTreeView::mousePressEvent(event); + setAutoScroll(true); +} + void PacketList::setColumnVisibility() { set_column_visibility_ = true; diff --git a/ui/qt/packet_list.h b/ui/qt/packet_list.h index 5a863d2db9..4bd89f6d82 100644 --- a/ui/qt/packet_list.h +++ b/ui/qt/packet_list.h @@ -81,6 +81,7 @@ protected: void contextMenuEvent(QContextMenuEvent *event); void timerEvent(QTimerEvent *event); void paintEvent(QPaintEvent *event); + virtual void mousePressEvent (QMouseEvent * event); protected slots: void rowsInserted(const QModelIndex &parent, int start, int end); -- cgit v1.2.1