summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-11-27 17:01:05 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2015-11-27 18:50:15 +0000
commit7d6373ee22ef01c1860a9c1f3fab5c02de53de0e (patch)
treeb8a59f7def4663dffd9695b3c83ac8e074f4154f
parent3cd7991f7f6bf6a776b50f4ee11812cbedc4454e (diff)
downloadwireshark-7d6373ee22ef01c1860a9c1f3fab5c02de53de0e.tar.gz
Qt: remove automatic horizontal scrolling when selecting a row
QTreeView automatically scrolls so as to show as much as possible the content of the selected column. Let's get rid of that. Rename PacketList::setAutoScroll() so that it does not overload QAbstractItemView::setAutoscroll() Change-Id: I09fb54f9b31c3025efddce6a4e709baaf107702d Reviewed-on: https://code.wireshark.org/review/12225 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> (cherry picked from commit 56625dd4562d89f711ab68caa8cf849509b0970f) Reviewed-on: https://code.wireshark.org/review/12230
-rw-r--r--ui/qt/main_window_slots.cpp6
-rw-r--r--ui/qt/packet_list.cpp3
-rw-r--r--ui/qt/packet_list.h2
3 files changed, 6 insertions, 5 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 528381ded3..5773f28185 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -821,7 +821,7 @@ void MainWindow::startCapture() {
GString *interface_names;
/* enable autoscroll timer as needed. */
- packet_list_->setAutoScroll(main_ui_->actionGoAutoScroll->isChecked());
+ packet_list_->setVerticalAutoScroll(main_ui_->actionGoAutoScroll->isChecked());
/* Add "interface name<live capture in progress>" on main status bar */
interface_names = get_iface_list_string(capture_opts, 0);
@@ -936,7 +936,7 @@ void MainWindow::stopCapture() {
main_ui_->statusBar->setFileName(capture_file_);
/* disable autoscroll timer if any. */
- packet_list_->setAutoScroll(false);
+ packet_list_->setVerticalAutoScroll(false);
}
// Keep focus rects from showing through the welcome screen. Primarily for
@@ -3316,7 +3316,7 @@ void MainWindow::on_actionGoPreviousConversationPacket_triggered()
void MainWindow::on_actionGoAutoScroll_toggled(bool checked)
{
- packet_list_->setAutoScroll(checked);
+ packet_list_->setVerticalAutoScroll(checked);
}
void MainWindow::resetPreviousFocus() {
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 60fadf6d7a..3b39b00c60 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -260,6 +260,7 @@ PacketList::PacketList(QWidget *parent) :
setRootIsDecorated(false);
setSortingEnabled(true);
setUniformRowHeights(true);
+ setAutoScroll(false);
setAccessibleName("Packet list");
overlay_sb_ = new OverlayScrollBar(Qt::Vertical, this);
@@ -754,7 +755,7 @@ void PacketList::recolorPackets()
/* Enable autoscroll timer. Note: must be called after the capture is started,
* otherwise the timer will not be executed. */
-void PacketList::setAutoScroll(bool enabled)
+void PacketList::setVerticalAutoScroll(bool enabled)
{
tail_at_end_ = enabled;
if (enabled && capture_in_progress_) {
diff --git a/ui/qt/packet_list.h b/ui/qt/packet_list.h
index f0786a5ecc..5a863d2db9 100644
--- a/ui/qt/packet_list.h
+++ b/ui/qt/packet_list.h
@@ -71,7 +71,7 @@ public:
QString packetComment();
void setPacketComment(QString new_comment);
QString allPacketComments();
- void setAutoScroll(bool enabled = true);
+ void setVerticalAutoScroll(bool enabled = true);
void setCaptureInProgress(bool in_progress = false) { capture_in_progress_ = in_progress; tail_at_end_ = in_progress; }
void captureFileReadFinished();