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
qgeomapitemsoverlay.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 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
7#include <QtLocation/private/qgeomap_p_p.h>
8#include <QtQuick/qsgnode.h>
9#include <QtQuick/qsgrectanglenode.h>
10#include <QtQuick/qquickwindow.h>
11
13
15{
16 Q_DECLARE_PUBLIC(QGeoMapItemsOverlay)
17public:
20
22
23 void setVisibleArea(const QRectF &visibleArea) override;
24 QRectF visibleArea() const override;
25
26protected:
27 void changeViewportSize(const QSize &size) override;
28 void changeCameraData(const QGeoCameraData &oldCameraData) override;
29 void changeActiveMapType(const QGeoMapType &mapType) override;
30
32};
33
34QGeoMapItemsOverlay::QGeoMapItemsOverlay(QGeoMappingManagerEngineItemsOverlay *engine, QObject *parent)
35 : QGeoMap(*(new QGeoMapItemsOverlayPrivate(engine, this)), parent)
36{
37
38}
39
43
45{
46 return Capabilities(SupportsVisibleRegion
47 | SupportsSetBearing
48 | SupportsAnchoringCoordinate);
49}
50
51void QGeoMapItemsOverlayPrivate::setVisibleArea(const QRectF &visibleArea)
52{
53 Q_Q(QGeoMapItemsOverlay);
54 const QRectF va = clampVisibleArea(visibleArea);
55 if (va == m_visibleArea)
56 return;
57
58 m_visibleArea = va;
59 m_geoProjection->setVisibleArea(va);
60
61 q->sgNodeChanged();
62}
63
65{
66 return m_visibleArea;
67}
68
69QSGNode *QGeoMapItemsOverlay::updateSceneGraph(QSGNode *node, QQuickWindow *)
70{
71 return node;
72}
73
74QGeoMapItemsOverlayPrivate::QGeoMapItemsOverlayPrivate(QGeoMappingManagerEngineItemsOverlay *engine, QGeoMapItemsOverlay *map)
75 : QGeoMapPrivate(engine, new QGeoProjectionWebMercator)
76{
77 Q_UNUSED(map);
78}
79
80QGeoMapItemsOverlayPrivate::~QGeoMapItemsOverlayPrivate()
81{
82}
83
84void QGeoMapItemsOverlayPrivate::updateObjectsGeometry()
85{
86}
87
88void QGeoMapItemsOverlayPrivate::changeViewportSize(const QSize &/*size*/)
89{
90 updateObjectsGeometry();
91}
92
93void QGeoMapItemsOverlayPrivate::changeCameraData(const QGeoCameraData &/*oldCameraData*/)
94{
95 updateObjectsGeometry();
96}
97
98void QGeoMapItemsOverlayPrivate::changeActiveMapType(const QGeoMapType &/*mapType*/)
99{
100 updateObjectsGeometry();
101}
102
103QT_END_NAMESPACE
void changeActiveMapType(const QGeoMapType &mapType) override
void changeViewportSize(const QSize &size) override
void setVisibleArea(const QRectF &visibleArea) override
void changeCameraData(const QGeoCameraData &oldCameraData) override
QRectF visibleArea() const override
QGeoMap::Capabilities capabilities() const override
QSGNode * updateSceneGraph(QSGNode *node, QQuickWindow *window) override
Combined button and popup list for selecting options.