X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=src%2Fjourneymodel.h;h=639c6d4f2ed15b9e58306ab8de319596b898248b;hp=398862a8cf804ccc8b45d1ef00ffa1004b932024;hb=refs%2Fheads%2Fmaster;hpb=e917baa52e7157c7c41424527c3881c22ff65588 diff --git a/src/journeymodel.h b/src/journeymodel.h index 398862a..639c6d4 100644 --- a/src/journeymodel.h +++ b/src/journeymodel.h @@ -15,7 +15,7 @@ public: StartRole = Qt::UserRole + 1, DurationRole, OvertookRole, - OvertakenByRole + OvertakenByRole, }; QHash roleNames() const; @@ -24,6 +24,8 @@ public: void addJourney(const Journey &journey); Q_INVOKABLE void addJourney(QDateTime start, quint32 duration, quint32 overtook, quint32 overtakenby); + Q_INVOKABLE void editJourney(quint32 index, QDateTime start, quint32 duration, quint32 overtook, quint32 overtakenby); + Q_INVOKABLE void deleteJourney(quint32 index); int rowCount(const QModelIndex & parent = QModelIndex()) const; @@ -36,6 +38,11 @@ public: Q_INVOKABLE static QDate epochToDate(quint64 epoch); Q_INVOKABLE static QTime epochToTime(quint64 epoch); + Q_INVOKABLE static QDateTime epochToDateTime(quint64 epoch); + + QList const & getData() const; + + void sort(int column, Qt::SortOrder order); signals: // General signals void journeysChanged();