https://bugs.kde.org/show_bug.cgi?id=371800
--- Comment #4 from abraa...@gmail.com ---
Comment on attachment 101866
--> https://bugs.kde.org/attachment.cgi?id=101866
patch: automatically adjust the width of the view headers
>From 4ec66687e337395aaf0f00198652719e4d9a3c80 Mon Sep 17 00:00:00 2001
>From: Staffan Palmroos
>Date: Fri, 28 Oct 2016 23:37:27 +0300
>Subject: [PATCH] Give the user the option to have the structure view headers
> automatically adjust their widths
>
>---
> .../settings/structviewdisplaysettingswidget.ui| 256 +++--
> kasten/controllers/view/structures/structview.cpp | 26 ++-
> kasten/controllers/view/structures/structview.h| 1 +
> 3 files changed, 158 insertions(+), 125 deletions(-)
>
>diff --git
>a/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
>
>b/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
>index c290815..1085251 100644
>---
>a/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
>+++
>b/kasten/controllers/view/structures/settings/structviewdisplaysettingswidget.ui
>@@ -6,135 +6,145 @@
>
> 0
> 0
>-411
>-292
>+310
>+421
>
>
>-
>-
>-
>-
>- QFormLayout::ExpandingFieldsGrow
>-
>-
>-
>+
>+
>+
>+ 7
>+ 7
>+ 297
>+ 407
>+
>+
>+
>+
>+
>+
>+ Byte order:
>+
>+
>+ kcfg_ByteOrder
>+
>+
>+
>+
>+
>+
>+ QComboBox::AdjustToContents
>+
>+
>
>-Byte order:
>+Big endian
>
>-
>-kcfg_ByteOrder
>-
>-
>-
>-
>-
>-
>-QComboBox::AdjustToContents
>-
>-
>-
>- Big endian
>-
>-
>-
>-
>- Little endian
>-
>-
>-
>-
>-
>-
>-
>-Use short type names
>-
>-
>-
>-
>-
>-
>-Use locale-aware integer formatting
>-
>-
>-
>-
>-
>-
>-Unsigned values:
>-
>-
>-combo_UnsignedDisplayBase
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-Signed values:
>-
>-
>-combo_SignedDisplayBase
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-Use locale-aware floating-point formatting
>-
>-
>-
>-
>-
>-
>-Floating-point precision:
>-
>-
>-kcfg_FloatPrecision
>-
>-
>-
>-
>-
>-
>-
>-
>+
>+
>
>-Show numerical value of chars
>-
>-
>-
>-
>-
>-
>-Character value:
>-
>-
>-combo_CharDisplayBase
>+Little endian
>
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>-
>+
>+
>+
>+
>+
>+
>+ Use short type names
>+
>+
>+
>+
>+
>+
>+ Use locale-aware integer formatting
>+
>+
>+
>+
>+
>+
>+ Unsigned values:
>+
>+
>+ combo_UnsignedDisplayBase
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+ Signed values:
>+
>+
>+ combo_SignedDisplayBase
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+ Use locale-aware floating-point formatting
>+
>+
>+
>+
>+
>+
>+ Floating-point precision:
>+
>+
>+ kcfg_FloatPrecision
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+ Show numerical value of chars
>+
>+
>+
>+
>+
>+
>+ Character value:
>+
>+
>+ combo_CharDisplayBase
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+
>+ Adjust header widths automatically
>+
>+
>+
>+
>+
>
>
>
>diff --git a/kasten/controllers/view/structures/structview.cpp
>b/kasten/controllers/view/structures/structview.cpp
>index df121dd..67da76a 100644
>--- a/kasten/controllers/view/structures/structview.cpp
>+++ b/kasten/controllers/view/structures/structview.cpp
>@@ -83,8 +83,14 @@ StructView::StructView(StructTool* tool, QWidget* parent) :
> mStructTreeView->setSortingEnabled(false);
> mStructTreeView->installEventFilter(this);
> QHeaderView* header = mStructTreeView->header();
>-header->setSectionResizeMode(QHeaderView::Interactive);
>-
>+if (Kasten::StructViewPreferences::autoAdjustHeaders())
>+{
>+header->setSectionResizeMode(QHeaderView::ResizeToContents);
>+}
>+else
>+{
>+header