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>
This commit is contained in:
Michal Labedzki 2015-12-14 17:19:39 +01:00
parent 846f08b97e
commit 0dbe79c53f
1 changed files with 6 additions and 0 deletions

View File

@ -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)