diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-07-29 22:33:07 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-07-29 22:33:07 +0200 |
| commit | 53c474283e4e378185d86f57384bb5d8ae933df4 (patch) | |
| tree | 93ec7e97ef35cd49f8f663d4e4f49d34acb96b0c /src/gui_qt.cc | |
| parent | 698b244807e85325d15c6583904575d2e00f43c5 (diff) | |
Make QT GUI columns resize to content
Diffstat (limited to 'src/gui_qt.cc')
| -rw-r--r-- | src/gui_qt.cc | 6 |
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 { |
