From 53c474283e4e378185d86f57384bb5d8ae933df4 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sat, 29 Jul 2017 22:33:07 +0200 Subject: Make QT GUI columns resize to content --- src/gui_qt.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui_qt.cc b/src/gui_qt.cc index 499ac08..94a00cd 100644 --- a/src/gui_qt.cc +++ b/src/gui_qt.cc @@ -1610,8 +1610,10 @@ bool QtGuiMain::run(int argc, char** argv) { }); tree->header()->setSectionsMovable(false); auto columns = listmodel_->columnCount(); - if (columns > 0) { - tree->header()->setSectionResizeMode(columns - 1, QHeaderView::Stretch); + for (int i = 0; i < columns; ++i) { + tree->header()->setSectionResizeMode( + i, i == columns - 1 ? QHeaderView::Stretch + : QHeaderView::ResizeToContents); } top_ = tree; } else { -- cgit v1.2.3-70-g09d2