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 
9 namespace 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 }
Binds a QML item to a specific geodetic location in screen coordinates.
QFuture< void > map(Sequence &sequence, MapFunctor function)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.