From c6f84de37c33ef66f479d1adcffea6eab903c674 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 28 May 2013 16:56:58 -0300 Subject: Adds the code to make the dive list behave like tree or list This code adds the possibility to make the DiveList behave like a Tree or a List, depending on what layout is set. Signed-off-by: Tomaz Canabrava --- qt-ui/models.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qt-ui/models.h') diff --git a/qt-ui/models.h b/qt-ui/models.h index f51566c1b..b4eb8d953 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -144,6 +144,8 @@ class DiveTripModel : public QAbstractItemModel Q_OBJECT public: + enum Layout{TREE, LIST}; + DiveTripModel(QObject *parent = 0); ~DiveTripModel(); @@ -155,11 +157,14 @@ public: /*reimp*/ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; /*reimp*/ QModelIndex parent(const QModelIndex &child) const; + Layout layout() const; + void setLayout(Layout layout); private: void setupModelData(); TreeItemDT *rootItem; QMap trips; + Layout currentLayout; }; #endif -- cgit v1.2.3-70-g09d2