Marble

MapThemeModel.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#ifndef MARBLE_DECLARATIVE_STREETMAPTHEMEMODEL_H
7#define MARBLE_DECLARATIVE_STREETMAPTHEMEMODEL_H
8
9#include <QSortFilterProxyModel>
10
11namespace Marble { class MapThemeManager; }
12
13class MapThemeModel : public QSortFilterProxyModel
14{
16
17 Q_PROPERTY( int count READ count NOTIFY countChanged )
18
19public:
20 enum MapThemeFilter {
21 AnyTheme = 0x0,
22 Terrestrial = 0x1,
23 Extraterrestrial = 0x2,
24 LowZoom = 0x4,
25 HighZoom = 0x8
26 };
27
28 Q_DECLARE_FLAGS(MapThemeFilters, MapThemeFilter)
29
30 Q_FLAGS(MapThemeFilter MapThemeFilters)
31
32 Q_PROPERTY( MapThemeFilters mapThemeFilter READ mapThemeFilter WRITE setMapThemeFilter NOTIFY mapThemeFilterChanged )
33
34public:
35 explicit MapThemeModel( QObject* parent = nullptr );
36
37 /** @todo FIXME https://bugreports.qt-project.org/browse/QTCOMPONENTS-1206 */
38 int count() const;
39
40 QHash<int, QByteArray> roleNames() const override;
41
42 Q_INVOKABLE QString name( const QString &id ) const;
43
44 Q_INVOKABLE int indexOf( const QString &id ) const;
45
46 Q_INVOKABLE MapThemeFilters mapThemeFilter() const;
47
48public Q_SLOTS:
49 void setMapThemeFilter( MapThemeFilters filters );
50
52 void countChanged();
53
54 void mapThemeFilterChanged();
55
56protected:
57 bool filterAcceptsRow(int sourceRow,
58 const QModelIndex &sourceParent) const override;
59
60private Q_SLOTS:
61 void handleChangedThemes();
62
63private:
64 Marble::MapThemeManager* m_themeManager;
65
66 QList<QString> m_streetMapThemeIds;
67
68 MapThemeFilters m_mapThemeFilters;
69
70 QHash<int, QByteArray> m_roleNames;
71};
72
73#endif
Provides access to all map themes installed locally.
The class that handles map themes that are locally available .
Binds a QML item to a specific geodetic location in screen coordinates.
Q_FLAGS(...)
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.