Qt: Always make the packet list row heights uniform.
authorGerald Combs <gerald@wireshark.org>
Wed, 23 Sep 2015 00:18:33 +0000 (17:18 -0700)
committerGerald Combs <gerald@wireshark.org>
Wed, 23 Sep 2015 20:53:18 +0000 (20:53 +0000)
commit30ff173a8792aede0901803b2dc37948e7406df7
tree78ca3e9392fe8fe45b5b0d0782c3342a471ed4e8
parent3ff5afd54131dc611ac08cf4f256a7c081c0cbb3
Qt: Always make the packet list row heights uniform.

In tests here using GTK+ 2.24 and 3.10, GtkTreeView handles multi-line
items by adjusting the height for all rows, but only after the number of
multi-line items exceeds some sort of threshold. For a packet capture
which contains a few DNS packets and a lot of TCP packets, if I change
"Standard query" to "Standard\nquery" in packet-dns.c I get
single-height packet list items. If I change "[TCP segment of a
reassembled PDU]" to "[TCP segment of a\nreassembled PDU]" in
packet-tcp.c (which results in more multi-line column strings) I get
double-height packet list items.

The current Qt code initially sets the uniformRowHeights property then
falls back to variable row heights if we run across a multi-line column
string. This adds a lot of logic which can impact other functionality
(e.g. column widths) and recalculating row heights is painfully slow for
large numbers of packets.

Instead of trying to manage variable row heights, always enable
uniformRowHeights. Track the maximum newline count and trigger a row
height adjustment when it changes. This mimics the GTK+ UI behavior,
although it should be more reliable.

Note that we need to adjust some numbers in RelatedPacketDelegate.

Change-Id: I289e963b6f00338c4374e602fa3fc83d04554519
Ping-Bug: 11515
Ping-Bug: 10924
Reviewed-on: https://code.wireshark.org/review/10628
Reviewed-by: Gerald Combs <gerald@wireshark.org>
ui/qt/packet_list.cpp
ui/qt/packet_list.h
ui/qt/packet_list_model.cpp
ui/qt/packet_list_model.h
ui/qt/related_packet_delegate.cpp