1
0
Fork 0
flightgear/src/GUI/AircraftSearchFilterModel.hxx
James Turner 4234876789 Move some Launcher helpers into their own files.
Suggested be Sebastian, and it’s a good idea indeed, the main
launcher file has grown slightly.
2017-04-10 14:38:57 +01:00

36 lines
840 B
C++

#ifndef AIRCRAFTSEARCHFILTERMODEL_HXX
#define AIRCRAFTSEARCHFILTERMODEL_HXX
#include <QSortFilterProxyModel>
#include <simgear/props/props.hxx>
class AircraftProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
AircraftProxyModel(QObject* pr);
void setRatings(int* ratings);
void setAircraftFilterString(QString s);
public slots:
void setRatingFilterEnabled(bool e);
void setInstalledFilterEnabled(bool e);
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
private:
bool filterAircraft(const QModelIndex& sourceIndex) const;
bool m_ratingsFilter = true;
bool m_onlyShowInstalled = false;
int m_ratings[4] = {3, 3, 3, 3};
QString m_filterString;
SGPropertyNode_ptr m_filterProps;
};
#endif // AIRCRAFTSEARCHFILTERMODEL_HXX