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)
16 explicit StationListProxyModel(QObject *parent = 0);
18 QString searchPattern() const;
19 void setSearchPattern(const QString &pattern);
21 Q_INVOKABLE void setUserPosition(const QGeoCoordinate &pos);
22 Q_INVOKABLE void setRecentStations(const QStringList &stations);
23 Q_INVOKABLE void setRecentOnlyFilter(bool);
26 virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
27 virtual bool filterAcceptsRow(int sourceRow,
28 const QModelIndex &sourceParent) const;
31 QString m_searchPattern;
32 QGeoCoordinate m_here;
33 QStringList m_stations;
34 bool m_filterRecentOnly;
37 #endif // STATIONLISTPROXYMODEL_H