summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 29157737f..cbb75c102 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -59,7 +59,8 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec
searchBox.hide();
connect(showSearchBox, SIGNAL(triggered(bool)), this, SLOT(showSearchEdit()));
connect(&searchBox, SIGNAL(textChanged(QString)), model, SLOT(setFilterFixedString(QString)));
- setupUi();
+ // calling setupUi() here appears to be too early; it does NOT correctly set the column widths
+ // setupUi();
}
DiveListView::~DiveListView()
@@ -315,6 +316,13 @@ void DiveListView::headerClicked(int i)
void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
{
+ // we want to run setupUi() once we actually are displaying something
+ // in the widget
+ static bool first = true;
+ if (first && dive_table.nr > 0) {
+ setupUi();
+ first = false;
+ }
if (layout == DiveTripModel::CURRENT)
layout = currentLayout;
else