Marble

RouteRelationModel.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2017 Sergey Popov <sergobot@protonmail.com>
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
14namespace Marble {
15
16class RouteRelationModel : public QAbstractListModel
17{
19
20public:
21 enum RouteRelationRoles {
22 IconSource = Qt::UserRole + 1,
23 Description,
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
43protected:
44 QHash<int, QByteArray> roleNames() const override;
45
46private:
47 static QString svgFile(const QString &path);
48
50 QMap<QString, QString> m_networks;
51};
52
53}
54
55#endif // ROUTERELATIONMODEL
Binds a QML item to a specific geodetic location in screen coordinates.
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_OBJECTQ_OBJECT
QObject * parent() const const
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.