aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-28 16:56:58 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-28 16:56:58 -0300
commitc6f84de37c33ef66f479d1adcffea6eab903c674 (patch)
tree8693cfa163a2ece07d281b8a860c650469990a12 /qt-ui/models.h
parent8394828806baf050fa833402c969139d52dc221d (diff)
downloadsubsurface-c6f84de37c33ef66f479d1adcffea6eab903c674.tar.gz
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 <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h5
1 files changed, 5 insertions, 0 deletions
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<dive_trip_t*, TripItem*> trips;
+ Layout currentLayout;
};
#endif