Marble

MapTheme.cpp
1#include "MapTheme.h"
2#include <MarbleModel.h>
3#include <MarbleQuickItem.h>
4
5#include <GeoSceneDocument.h>
6#include <GeoSceneHead.h>
7#include <GeoSceneLicense.h>
8
9namespace Marble
10{
11MapTheme::MapTheme(QObject *parent)
12 : QObject(parent)
13 , m_map(nullptr)
14{
15}
16
17Marble::MarbleQuickItem *MapTheme::map() const
18{
19 return m_map;
20}
21
22QString MapTheme::license() const
23{
24 const GeoSceneDocument *const mapTheme = m_map->model()->mapTheme();
25 if (!mapTheme)
26 return {};
27
28 const GeoSceneHead *const head = mapTheme->head();
29 if (!head)
30 return {};
31
32 const GeoSceneLicense *license = head->license();
33 return license->shortLicense();
34}
35
36void MapTheme::setMap(MarbleQuickItem *map)
37{
38 if (m_map == map)
39 return;
40 disconnect(m_map, &MarbleQuickItem::mapThemeIdChanged, this, &MapTheme::licenseChanged);
41 connect(map, &MarbleQuickItem::mapThemeIdChanged, this, &MapTheme::licenseChanged);
42
43 m_map = map;
44
45 Q_EMIT mapChanged(m_map);
46 Q_EMIT licenseChanged();
47}
48}
49
50#include "moc_MapTheme.cpp"
This file contains the headers for MarbleModel.
Binds a QML item to a specific geodetic location in screen coordinates.
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.