diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-11-28 00:06:56 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-11-28 07:45:22 +0000 |
commit | afb7b42360991f38fda3962eb6899562a2d75d6d (patch) | |
tree | 4cc9c3748095b3329ff9e7e2d4fe3e47efdebae2 | |
parent | a08283900f8767a049b03f641056a7486e6934e8 (diff) | |
download | wireshark-afb7b42360991f38fda3962eb6899562a2d75d6d.tar.gz |
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 <pascal.quantin@gmail.com>
(cherry picked from commit df83e45084f7a8430225f646a03d1974b188d3ca)
Reviewed-on: https://code.wireshark.org/review/12241
-rw-r--r-- | ui/qt/packet_list.cpp | 8 | ||||
-rw-r--r-- | ui/qt/packet_list.h | 1 |
2 files changed, 8 insertions, 1 deletions
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); |