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