Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qplaceresult.cpp
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#include "qplaceresult.h"
5#include "qplaceresult_p.h"
6#include <QtCore/qnumeric.h>
7
9
11{
12 const QPlaceResultPrivate *od = static_cast<const QPlaceResultPrivate *>(other);
14 && ((qIsNaN(distance) && qIsNaN(od->distance))
15 || qFuzzyCompare(distance, od->distance))
16 && place == od->place
17 && sponsored == od->sponsored;
18}
19
50
57
63
65
66
74{
75 Q_D(const QPlaceResult);
76 return d->distance;
77}
78
83{
84 Q_D(QPlaceResult);
85 d->distance = distance;
86}
87
92{
93 Q_D(const QPlaceResult);
94 return d->place;
95}
96
101{
102 Q_D(QPlaceResult);
103 d->place = place;
104}
105
112{
113 Q_D(const QPlaceResult);
114 return d->sponsored;
115}
116
122void QPlaceResult::setSponsored(bool sponsored)
123{
124 Q_D(QPlaceResult);
125 d->sponsored = sponsored;
126}
bool compare(const QPlaceSearchResultPrivate *other) const override
\inmodule QtLocation
void setDistance(qreal distance)
Set the distance of the search result's place from a search center.
void setPlace(const QPlace &place)
Sets the place that this result refers to.
bool isSponsored() const
Returns true if the result is a sponsored result.
virtual ~QPlaceResult()
Destructor.
qreal distance() const
Returns the distance of the place to the search center.
QPlaceResult()
Constructs a new place result object.
QPlace place() const
Returns the place of the search result.
void setSponsored(bool sponsored)
Sets whether the result is a sponsored result or not.
virtual bool compare(const QPlaceSearchResultPrivate *other) const
\inmodule QtLocation
\inmodule QtLocation
Definition qplace.h:25
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:333
bool qIsNaN(qfloat16 f) noexcept
Definition qfloat16.h:284
GLsizei GLsizei GLfloat distance
#define Q_IMPLEMENT_SEARCHRESULT_D_FUNC(Class)
#define Q_IMPLEMENT_SEARCHRESULT_COPY_CTOR(Class)
double qreal
Definition qtypes.h:187
QSharedPointer< T > other(t)
[5]