mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8394828806
commit
c6f84de37c
3 changed files with 35 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue