From 199ecf2983909a322db937016a3cfaa046f48f78 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Thu, 19 Jan 2023 19:41:07 -0500 Subject: [PATCH] Qt: Clear selection, not current, in drawCurrentPacket QItemSelectionModel tracks both the selected index and the current index. PacketList redraws when the *selected* index changes, not the current index. Clearing the current index, and then marking the same packet as selected and current fires currentChanged but not selectionChanged. So drawCurrentPacket needs to call clearSelection(), not clearCurrentIndex(), in order to trigger a redissection of the currently selected packet and update the packet details. For example, if you mark or unmark the currently selected frame, this causes the packet details to update. Cf 52955b9c43a99942b3, which fixed the same issue but for Find Packet. Fix #14330. --- ui/qt/packet_list.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 831121ac7d..63af95ddf0 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -1031,7 +1031,7 @@ void PacketList::drawCurrentPacket() { QModelIndex current_index = currentIndex(); if (selectionModel() && current_index.isValid()) { - selectionModel()->clearCurrentIndex(); + selectionModel()->clearSelection(); selectionModel()->setCurrentIndex(current_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); } }