From e5b17092b42a6ca7aaefb94d736dfbbd417e9893 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 16 Sep 2020 00:01:16 +0200 Subject: [PATCH] Fix stretchheaderview column widths too wide --- src/widgets/stretchheaderview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/stretchheaderview.cpp b/src/widgets/stretchheaderview.cpp index 0544f5c46..5f03f8db4 100644 --- a/src/widgets/stretchheaderview.cpp +++ b/src/widgets/stretchheaderview.cpp @@ -44,7 +44,10 @@ StretchHeaderView::StretchHeaderView(const Qt::Orientation orientation, QWidget : QHeaderView(orientation, parent), stretch_enabled_(false), in_mouse_move_event_(false) { + connect(this, SIGNAL(sectionResized(int,int,int)), SLOT(SectionResized(int,int,int))); + setMinimumSectionSize(kMinimumColumnWidth); + } void StretchHeaderView::setModel(QAbstractItemModel *model) { @@ -92,9 +95,6 @@ void StretchHeaderView::UpdateWidths(const QList §ions) { const ColumnWidthType w = column_widths_[i]; int pixels = w * width(); - if (pixels != 0 && total_w - int(total_w) > 0.5) - pixels ++; - total_w += w; if (!sections.isEmpty() && !sections.contains(i))