Marble

RouteRelationModel.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2017 Sergey Popov <[email protected]>
4 //
5 
6 #ifndef MARBLE_DECLARATIVE_ROUTERELATIONMODEL_H
7 #define MARBLE_DECLARATIVE_ROUTERELATIONMODEL_H
8 
9 #include <QAbstractListModel>
10 #include <QSet>
11 
12 #include "GeoDataRelation.h"
13 
14 namespace Marble {
15 
16 class RouteRelationModel : public QAbstractListModel
17 {
18  Q_OBJECT
19 
20 public:
21  enum RouteRelationRoles {
22  IconSource = Qt::UserRole + 1,
24  Network,
25  RouteColor,
26  TextColor,
27  RouteFrom,
28  RouteTo,
29  RouteRef,
30  RouteVia,
31  OsmId,
32  RouteVisible
33  };
34 
35  explicit RouteRelationModel(QObject* parent = nullptr);
36 
37  void setRelations(const QSet<const GeoDataRelation *> &relations);
38 
39  int rowCount(const QModelIndex & parent = QModelIndex()) const override;
40 
41  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
42 
43 protected:
44  QHash<int, QByteArray> roleNames() const override;
45 
46 private:
47  static QString svgFile(const QString &path);
48 
50  QMap<QString, QString> m_networks;
51 };
52 
53 }
54 
55 #endif // ROUTERELATIONMODEL
Q_OBJECTQ_OBJECT
UserRole
Description
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Oct 4 2023 04:09:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.