Fix stretchheaderview column widths too wide

This commit is contained in:
Jonas Kvinge 2020-09-16 00:01:16 +02:00
parent 466cb4c78b
commit e5b17092b4
1 changed files with 3 additions and 3 deletions

View File

@ -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<int> &sections) {
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))