aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2023-01-19 19:41:07 -0500
committerJohn Thacker <johnthacker@gmail.com>2023-01-19 19:51:37 -0500
commit199ecf2983909a322db937016a3cfaa046f48f78 (patch)
tree8f6db98f490f9f53c5466d8f0ebd6c306a65824d
parentc380f516a21efd87b794c6c1495ba6a6e5b3defe (diff)
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.
-rw-r--r--ui/qt/packet_list.cpp2
1 files changed, 1 insertions, 1 deletions
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);
}
}