Marble

MapTheme.cpp
1#include "MapTheme.h"
2#include <MarbleQuickItem.h>
3#include <MarbleModel.h>
4
5#include <GeoSceneDocument.h>
6#include <GeoSceneHead.h>
7#include <GeoSceneLicense.h>
8
9namespace Marble
10{
11 MapTheme::MapTheme(QObject *parent) :
12 QObject( parent ),
13 m_map(nullptr)
14 {
15 }
16
17 Marble::MarbleQuickItem *MapTheme::map() const
18 {
19 return m_map;
20 }
21
22 QString MapTheme::license() const
23 {
24 const GeoSceneDocument *const mapTheme = m_map->model()->mapTheme();
25 if ( !mapTheme )
26 return QString();
27
28 const GeoSceneHead *const head = mapTheme->head();
29 if ( !head )
30 return QString();
31
32 const GeoSceneLicense *license = head->license();
33 return license->shortLicense();
34 }
35
36 void 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 emit mapChanged(m_map);
46 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 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.