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{
16
17class RouteRelationModel : public QAbstractListModel
18{
20
21public:
22 enum RouteRelationRoles {
23 IconSource = Qt::UserRole + 1,
24 Description,
25 Network,
26 RouteColor,
27 TextColor,
28 RouteFrom,
29 RouteTo,
30 RouteRef,
31 RouteVia,
32 OsmId,
33 RouteVisible
34 };
35
36 explicit RouteRelationModel(QObject *parent = nullptr);
37
38 void setRelations(const QSet<const GeoDataRelation *> &relations);
39
40 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
41
42 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
43
44protected:
45 QHash<int, QByteArray> roleNames() const override;
46
47private:
48 static QString svgFile(const QString &path);
49
51 QMap<QString, QString> m_networks;
52};
53
54}
55
56#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 Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.