From 0dbe79c53fe40cd388bd84eac452cb48d204ef13 Mon Sep 17 00:00:00 2001 From: Michal Labedzki Date: Mon, 14 Dec 2015 17:19:39 +0100 Subject: Qt: Resize columns to contents in DecodeAs If user first time run DecodeAs columns width are not enough, so content are trimmed. Do resizing whenever add new item. Change-Id: I378e2a5b2134479d961f3f00d398d8052f7e556d Reviewed-on: https://code.wireshark.org/review/13392 Petri-Dish: Michal Labedzki Tested-by: Petri Dish Buildbot Reviewed-by: Michal Labedzki --- ui/qt/decode_as_dialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui/qt/decode_as_dialog.cpp') diff --git a/ui/qt/decode_as_dialog.cpp b/ui/qt/decode_as_dialog.cpp index 104ed0c8e5..0ba94aa556 100644 --- a/ui/qt/decode_as_dialog.cpp +++ b/ui/qt/decode_as_dialog.cpp @@ -361,6 +361,12 @@ void DecodeAsDialog::addRecord(bool copy_from_current) } activateLastItem(); + + if (ui->decodeAsTreeWidget->topLevelItemCount() > 0) { + for (int i = 0; i < ui->decodeAsTreeWidget->columnCount(); i++) { + ui->decodeAsTreeWidget->resizeColumnToContents(i); + } + } } void DecodeAsDialog::fillTypeColumn(QTreeWidgetItem *item) -- cgit v1.2.1