summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2017-07-29 22:33:07 +0200
committerJoel Klinghed <the_jk@yahoo.com>2017-07-29 22:33:07 +0200
commit53c474283e4e378185d86f57384bb5d8ae933df4 (patch)
tree93ec7e97ef35cd49f8f663d4e4f49d34acb96b0c
parent698b244807e85325d15c6583904575d2e00f43c5 (diff)
Make QT GUI columns resize to content
-rw-r--r--src/gui_qt.cc6
1 files 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 {