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
4
#
include
"qgeocoordinateobject_p.h"
5
6
QT_BEGIN_NAMESPACE
7
8
QT_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
18
QGeoCoordinateObject::QGeoCoordinateObject(QObject *parent) : QObject(parent)
19
{
20
}
21
22
QGeoCoordinateObject::QGeoCoordinateObject(
const
QGeoCoordinate &c, QObject *parent) : QObject(parent)
23
{
24
setCoordinate(c);
25
}
26
27
QGeoCoordinateObject::~QGeoCoordinateObject()
28
{
29
30
}
31
32
bool
QGeoCoordinateObject::operator==(
const
QGeoCoordinateObject &other)
const
33
{
34
return
m_coordinate.value() == other.m_coordinate.value();
35
}
36
37
bool
QGeoCoordinateObject::operator==(
const
QGeoCoordinate &other)
const
38
{
39
return
m_coordinate.value() == other;
40
}
41
42
QGeoCoordinate QGeoCoordinateObject::coordinate()
const
43
{
44
return
m_coordinate;
45
}
46
47
void
QGeoCoordinateObject::setCoordinate(
const
QGeoCoordinate &c)
48
{
49
m_coordinate = c;
// The signal is emitted automatically if needed
50
}
51
52
QBindable<QGeoCoordinate> QGeoCoordinateObject::bindableCoordinate()
53
{
54
return
QBindable<QGeoCoordinate>(&m_coordinate);
55
}
56
57
QT_END_NAMESPACE
58
59
#
include
"moc_qgeocoordinateobject_p.cpp"
qtpositioning
src
positioning
qgeocoordinateobject.cpp
Generated on
for Qt by
1.14.0