diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2015-12-14 17:19:39 +0100 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2016-01-20 07:02:12 +0000 |
commit | 0dbe79c53fe40cd388bd84eac452cb48d204ef13 (patch) | |
tree | b6ad56191b3a15dcc2c4811c8fb3dff3f3251926 /ui/qt/decode_as_dialog.cpp | |
parent | 846f08b97ecd08b3b0c14accec4977919ac786ac (diff) | |
download | wireshark-0dbe79c53fe40cd388bd84eac452cb48d204ef13.tar.gz |
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 <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'ui/qt/decode_as_dialog.cpp')
-rw-r--r-- | ui/qt/decode_as_dialog.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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) |