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
locationsingleton_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
5#ifndef LOCATIONSINGLETON_H
6#define LOCATIONSINGLETON_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/QObject>
20#include <QtCore/qnumeric.h>
21#include <QtPositioning/QGeoCoordinate>
22#include <QtPositioning/QGeoShape>
23#include <QtPositioning/QGeoRectangle>
24#include <QtPositioning/QGeoCircle>
25#include <QtPositioning/QGeoPath>
26#include <QtPositioning/QGeoPolygon>
27#include <QtQml/QJSValue>
28#include <QVariant>
29#include <QPointF>
30#include <QQmlEngine>
31#include <QtPositioningQuick/private/qpositioningquickglobal_p.h>
32
34
36{
37 Q_OBJECT
38 QML_NAMED_ELEMENT(QtPositioning)
39 QML_SINGLETON
40 QML_ADDED_IN_VERSION(5, 0)
41
42public:
43 explicit LocationSingleton(QObject *parent = 0);
44
45 Q_INVOKABLE QGeoCoordinate coordinate() const;
46 Q_INVOKABLE QGeoCoordinate coordinate(double latitude, double longitude,
47 double altitude = qQNaN()) const;
48
49 Q_INVOKABLE QGeoShape shape() const;
50
51 Q_INVOKABLE QGeoRectangle rectangle() const;
52 Q_INVOKABLE QGeoRectangle rectangle(const QGeoCoordinate &center,
53 double width, double height) const;
54 Q_INVOKABLE QGeoRectangle rectangle(const QGeoCoordinate &topLeft,
55 const QGeoCoordinate &bottomRight) const;
56 Q_INVOKABLE QGeoRectangle rectangle(const QVariantList &coordinates) const;
57
58 Q_INVOKABLE QGeoCircle circle() const;
59 Q_INVOKABLE QGeoCircle circle(const QGeoCoordinate &center, qreal radius = -1.0) const;
60
61 Q_INVOKABLE QGeoPath path() const;
62 Q_INVOKABLE QGeoPath path(const QJSValue &value, qreal width = 0.0) const;
63
64 Q_INVOKABLE QGeoPolygon polygon() const;
65 Q_INVOKABLE QGeoPolygon polygon(const QVariantList &value) const;
66 Q_INVOKABLE QGeoPolygon polygon(const QVariantList &perimeter, const QVariantList &holes) const;
67
68 Q_INVOKABLE QGeoCircle shapeToCircle(const QGeoShape &shape) const;
69 Q_INVOKABLE QGeoRectangle shapeToRectangle(const QGeoShape &shape) const;
70 Q_INVOKABLE QGeoPath shapeToPath(const QGeoShape &shape) const;
71 Q_INVOKABLE QGeoPolygon shapeToPolygon(const QGeoShape &shape) const;
72
73 Q_REVISION(5, 12) Q_INVOKABLE QGeoCoordinate mercatorToCoord(const QPointF &mercator) const;
74 Q_REVISION(5, 12) Q_INVOKABLE QPointF coordToMercator(const QGeoCoordinate &coord) const;
75};
76
77QT_END_NAMESPACE
78
79#endif // LOCATIONSINGLETON_H
static QT_BEGIN_NAMESPACE QGeoCoordinate parseCoordinate(const QJSValue &value, bool *ok)
Combined button and popup list for selecting options.