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.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 4957e3374..d53fce5f5 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -22,6 +22,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec
setItemDelegateForColumn(TreeItemDT::RATING, new StarWidgetsDelegate());
QSortFilterProxyModel *model = new QSortFilterProxyModel(this);
setModel(model);
+ setSortingEnabled(false);
header()->setContextMenuPolicy(Qt::ActionsContextMenu);
}
@@ -31,7 +32,10 @@ void DiveListView::reload()
QAbstractItemModel *oldModel = m->sourceModel();
if (oldModel)
oldModel->deleteLater();
- m->setSourceModel(new DiveTripModel(this));
+ DiveTripModel *tripModel = new DiveTripModel(this);
+ tripModel->setLayout(DiveTripModel::LIST);
+
+ m->setSourceModel(tripModel);
sortByColumn(0, Qt::DescendingOrder);
QModelIndex firstDiveOrTrip = m->index(0,0);
if (firstDiveOrTrip.isValid()) {