Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdeclarativegeomapquickitem_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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
4#ifndef QDECLARATIVEGEOMAPQUICKITEM_H
5#define QDECLARATIVEGEOMAPQUICKITEM_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtLocation/private/qlocationglobal_p.h>
19
20#include <QtQuick/QQuickItem>
21#include <QtQuick/QSGNode>
22
23#include <QtLocation/private/qdeclarativegeomap_p.h>
24#include <QtLocation/private/qdeclarativegeomapitembase_p.h>
25#include <QtPositioning/qgeoshape.h>
26
28
30{
31public:
33
34 void setMatrix(const QMatrix4x4& matrix);
35 void applyTo(QMatrix4x4 *matrix) const override;
36
38};
39
40class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapQuickItem : public QDeclarativeGeoMapItemBase
41{
43 QML_NAMED_ELEMENT(MapQuickItem)
45 Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged)
46 Q_PROPERTY(QPointF anchorPoint READ anchorPoint WRITE setAnchorPoint NOTIFY anchorPointChanged)
47 Q_PROPERTY(qreal zoomLevel READ zoomLevel WRITE setZoomLevel NOTIFY zoomLevelChanged)
48 Q_PROPERTY(QQuickItem *sourceItem READ sourceItem WRITE setSourceItem NOTIFY sourceItemChanged)
49
50public:
53
54 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
55
56 void setCoordinate(const QGeoCoordinate &coordinate);
58
59 void setSourceItem(QQuickItem *sourceItem);
61
62 void setAnchorPoint(const QPointF &anchorPoint);
63 QPointF anchorPoint() const;
64
65 void setZoomLevel(qreal zoomLevel);
66 qreal zoomLevel() const;
67
68 const QGeoShape &geoShape() const override;
69 void setGeoShape(const QGeoShape &shape) override;
70
76
77protected:
78 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
79 void updatePolish() override;
80
81protected Q_SLOTS:
82 void afterChildrenChanged() override;
84
85private:
86 qreal scaleFactor();
87 QGeoCoordinate coordinate_;
88 QGeoRectangle geoshape_;
89 QPointer<QQuickItem> sourceItem_;
90 QQuickItem *opacityContainer_ = nullptr;
91 QPointF anchorPoint_;
92 qreal zoomLevel_ = 0.0;
93 bool mapAndSourceItemSet_ = false;
94 bool updatingGeometry_ = false;
95 QMapQuickItemMatrix4x4 *matrix_ = nullptr;
96
97 friend class QDeclarativeGeoMap;
98};
99
101
103
104#endif
virtual void afterViewportChanged(const QGeoMapViewportChangeEvent &event)=0
virtual void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
virtual void setGeoShape(const QGeoShape &shape)=0
QGeoCoordinate coordinate()
\inmodule QtPositioning
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeoshape.h:17
void applyTo(QMatrix4x4 *matrix) const override
void setMatrix(const QMatrix4x4 &matrix)
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
\inmodule QtCore\reentrant
Definition qpoint.h:214
\inmodule QtCore
Definition qpointer.h:18
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
virtual void updatePolish()
This function should perform any layout as required for this item.
\inmodule QtCore\reentrant
Definition qrect.h:483
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
struct _cl_event * event
GLuint GLenum matrix
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:92
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent