36d4a922c48843bded8ef08f098dc9a22527d73d
4 #include <QAbstractListModel>
10 class JourneyModel
: public QAbstractListModel
15 StartRole
= Qt::UserRole
+ 1,
21 QHash
<int, QByteArray
> roleNames() const;
23 JourneyModel(QObject
*parent
= 0);
25 void addJourney(const Journey
&journey
);
27 int rowCount(const QModelIndex
& parent
= QModelIndex()) const;
29 QVariant
data(const QModelIndex
& index
, int role
= Qt::DisplayRole
) const;
33 void exportToFile(QFile
& file
);
34 void importFromFile(QFile
& file
);
38 void journeysChanged();
41 QHash
<int, QByteArray
> roles
;
42 QList
<Journey
> journeys
;
45 #endif // JOURNEYMODEL_H