FlightGear next
DefaultAircraftLocator.hxx
Go to the documentation of this file.
1#ifndef DEFAULTAIRCRAFTLOCATOR_HXX
2#define DEFAULTAIRCRAFTLOCATOR_HXX
3
4#include <string>
5#include <simgear/misc/sg_path.hxx>
6
8
9#include <QAbstractListModel>
10
11namespace flightgear
12{
13
14std::string defaultAirportICAO();
15
17
24{
25public:
27
28 SGPath foundPath() const;
29
30private:
31 virtual VisitResult visit(const SGPath& p) override;
32
33 std::string _aircraftId;
34 SGPath _foundPath;
35};
36
37class WeatherScenariosModel : public QAbstractListModel
38{
39 Q_OBJECT
40public:
41 WeatherScenariosModel(QObject* pr = nullptr);
42
43 int rowCount(const QModelIndex& index) const override;
44
45 QVariant data(const QModelIndex& index, int role) const override;
46
47 QHash<int, QByteArray> roleNames() const override;
48
49 Q_INVOKABLE QString metarForItem(quint32 index) const;
50
51 Q_INVOKABLE QString nameForItem(quint32 index) const;
52
53 Q_INVOKABLE QString descriptionForItem(quint32 index) const;
54
55 Q_INVOKABLE QStringList localWeatherData(quint32 index) const;
56private:
57 struct WeatherScenario
58 {
59 QString name;
60 QString description;
61 QString metar;
62 QString localWeatherTileType;
63 QString localWeatherTileManagement;
64 };
65
66 std::vector<WeatherScenario> m_scenarios;
67
68 enum {
69 NameRole = Qt::UserRole + 1,
70 DescriptionRole,
71 MetarRole,
72 };
73};
74
75}
76
77#endif // DEFAULTAIRCRAFTLOCATOR_HXX
#define p(x)
QHash< int, QByteArray > roleNames() const override
Q_INVOKABLE QString nameForItem(quint32 index) const
Q_INVOKABLE QString metarForItem(quint32 index) const
Q_INVOKABLE QStringList localWeatherData(quint32 index) const
int rowCount(const QModelIndex &index) const override
Q_INVOKABLE QString descriptionForItem(quint32 index) const
QVariant data(const QModelIndex &index, int role) const override
std::vector< std::string > string_list
Definition globals.hxx:36
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
Definition Addon.cxx:53
const char * name
string_list defaultSplashScreenPaths()
std::string defaultAirportICAO()