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
qgeocoordinateobject.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
6
7QT_BEGIN_NAMESPACE
8
9QT_IMPL_METATYPE_EXTERN_TAGGED(QGeoCoordinateObject*, QGeoCoordinateObject_ptr)
10
11/*
12
13 Note: This class only purpose is to enable conversion between QGeoCoordinate and QDeclarativeGeoWaypoint.
14 Since QGeoCoordinate lives in the QtPositioning module, this class acts as a base for QDeclarativeGeoWaypoint,
15 and contains the bare minimum to convert/compare to a QGeoCoordinate
16
17*/
18
19QGeoCoordinateObject::QGeoCoordinateObject(QObject *parent) : QObject(parent)
20{
21}
22
23QGeoCoordinateObject::QGeoCoordinateObject(const QGeoCoordinate &c, QObject *parent) : QObject(parent)
24{
25 setCoordinate(c);
26}
27
28QGeoCoordinateObject::~QGeoCoordinateObject()
29{
30
31}
32
33bool QGeoCoordinateObject::operator==(const QGeoCoordinateObject &other) const
34{
35 return m_coordinate.value() == other.m_coordinate.value();
36}
37
38bool QGeoCoordinateObject::operator==(const QGeoCoordinate &other) const
39{
40 return m_coordinate.value() == other;
41}
42
43QGeoCoordinate QGeoCoordinateObject::coordinate() const
44{
45 return m_coordinate;
46}
47
48void QGeoCoordinateObject::setCoordinate(const QGeoCoordinate &c)
49{
50 m_coordinate = c; // The signal is emitted automatically if needed
51}
52
53QBindable<QGeoCoordinate> QGeoCoordinateObject::bindableCoordinate()
54{
55 return QBindable<QGeoCoordinate>(&m_coordinate);
56}
57
58QT_END_NAMESPACE
59
60#include "moc_qgeocoordinateobject_p.cpp"