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