1 #ifndef STATIONLISTPROXYMODEL_H
2 #define STATIONLISTPROXYMODEL_H
4 #include <QSortFilterProxyModel>
5 #include <QGeoCoordinate>
10 class StationListProxyModel : public QSortFilterProxyModel
13 Q_PROPERTY(QString searchPattern READ searchPattern WRITE setSearchPattern)
24 explicit StationListProxyModel(QObject *parent = 0);
26 QString searchPattern() const;
27 void setSearchPattern(const QString &pattern);
29 Q_INVOKABLE void setUserPosition(const QGeoCoordinate &pos);
30 Q_INVOKABLE void setRecentStations(const QStringList &stations);
31 Q_INVOKABLE void setRecentOnlyFilter(bool);
34 virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
35 virtual bool filterAcceptsRow(int sourceRow,
36 const QModelIndex &sourceParent) const;
39 QString m_searchPattern;
40 QGeoCoordinate m_here;
41 QStringList m_stations;
42 bool m_filterRecentOnly;
45 #endif // STATIONLISTPROXYMODEL_H