Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgeomappingmanager.cpp
Go to the documentation of this file.
1// Copyright (C) 2015 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
9
10
11#include "qgeomap_p.h"
12
13#include <QTimer>
14#include <QLocale>
15
16QT_BEGIN_NAMESPACE
17
18/*!
19 \class QGeoMappingManager
20 \inmodule QtLocation
21 \ingroup QtLocation-maps
22 \since 5.6
23 \internal
24
25 \brief The QGeoMappingManager class provides support for displaying
26 and interacting with maps.
27*/
28
29/*!
30 Constructs a new manager with the specified \a parent and with the
31 implementation provided by \a engine.
32
33 This constructor is used internally by QGeoServiceProviderFactory. Regular
34 users should acquire instances of QGeoMappingManager with
35 QGeoServiceProvider::mappingManager()
36*/
37QGeoMappingManager::QGeoMappingManager(QGeoMappingManagerEngine *engine, QObject *parent)
38 : QObject(parent),
39 d_ptr(new QGeoMappingManagerPrivate)
40{
41 d_ptr->engine = engine;
42 if (!d_ptr->engine) {
43 qFatal("The mapping manager engine that was set for this mapping manager was NULL.");
44 }
45
46 connect(d_ptr->engine, &QGeoMappingManagerEngine::initialized,
47 this, &QGeoMappingManager::initialized, Qt::QueuedConnection);
48
49 connect(d_ptr->engine, &QGeoMappingManagerEngine::supportedMapTypesChanged,
50 this, &QGeoMappingManager::supportedMapTypesChanged, Qt::QueuedConnection);
51}
52
53/*!
54 Destroys this mapping manager.
55*/
56QGeoMappingManager::~QGeoMappingManager()
57{
58 delete d_ptr;
59}
60
61/*!
62 \fn void QGeoMappingManager::initialized()
63
64 This signal is emitted when the mapping manager has been initialized
65 and is ready to be used.
66*/
67
68/*!
69 Returns the name of the engine which implements the behaviour of this
70 mapping manager.
71
72 The combination of managerName() and managerVersion() should be unique
73 amongst the plugin implementations.
74*/
75QString QGeoMappingManager::managerName() const
76{
77 return d_ptr->engine->managerName();
78}
79
80/*!
81 Returns the version of the engine which implements the behaviour of this
82 mapping manager.
83
84 The combination of managerName() and managerVersion() should be unique
85 amongst the plugin implementations.
86*/
87int QGeoMappingManager::managerVersion() const
88{
89 return d_ptr->engine->managerVersion();
90}
91
92/*!
93 Returns a new QGeoMap instance which will be managed by this manager.
94*/
95QGeoMap *QGeoMappingManager::createMap(QObject *parent)
96{
97 Q_UNUSED(parent);
98 return d_ptr->engine->createMap();
99}
100
101QList<QGeoMapType> QGeoMappingManager::supportedMapTypes() const
102{
103 return d_ptr->engine->supportedMapTypes();
104}
105
106/*!
107 Return whether the manager has been initialized
108 (will be done automatically but may take some time).
109
110*/
111bool QGeoMappingManager::isInitialized() const
112{
113 return d_ptr->engine->isInitialized();
114}
115
116/*!
117 Sets the locale to be used by the this manager to \a locale.
118
119 If this mapping manager supports returning map labels
120 in different languages, they will be returned in the language of \a locale.
121
122 The locale used defaults to the system locale if this is not set.
123*/
124void QGeoMappingManager::setLocale(const QLocale &locale)
125{
126 d_ptr->engine->setLocale(locale);
127}
128
129/*!
130 Returns the locale used to hint to this mapping manager about what
131 language to use for map labels.
132*/
133QLocale QGeoMappingManager::locale() const
134{
135 return d_ptr->engine->locale();
136}
137
138/*******************************************************************************
139*******************************************************************************/
140
142
147
148QT_END_NAMESPACE
QGeoMappingManagerEngine * engine