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
qplacematchreply.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// Qt-Security score:significant reason:default
4
7#include "qplace.h"
9
10
13{
14public:
16 QPlaceMatchRequest request;
17};
18
19QT_END_NAMESPACE
20
21QT_USE_NAMESPACE
22
23/*!
24 \class QPlaceMatchReply
25 \inmodule QtLocation
26 \ingroup QtLocation-places
27 \ingroup QtLocation-places-replies
28 \since 5.6
29
30 \brief The QPlaceMatchReply class manages a place matching operation started by an
31 instance of QPlaceManager.
32
33 If the operation is successful, the number of places in the reply matches those
34 in the request. If a particular place in the request is not found, a default
35 constructed place is used as a place holder in the reply. In this way, there
36 is always a one is to one relationship between input places in the request,
37 and output places in the reply.
38
39 If the operation is not successful the number of places is always zero.
40
41 See \l {Matching places between managers} for an example on how to use
42 a match reply.
43
44 \sa QPlaceMatchRequest, QPlaceManager
45*/
46
47/*!
48 Constructs a match reply with a given \a parent.
49*/
50QPlaceMatchReply::QPlaceMatchReply(QObject *parent)
51 : QPlaceReply(new QPlaceMatchReplyPrivate, parent)
52{
53}
54
55/*!
56 Destroys the match reply.
57*/
58QPlaceMatchReply::~QPlaceMatchReply()
59{
60}
61
62/*!
63 Returns the type of reply.
64*/
65QPlaceReply::Type QPlaceMatchReply::type() const
66{
67 return QPlaceReply::MatchReply;
68}
69
70 /*!
71 Returns a list of matching places;
72*/
73QList<QPlace> QPlaceMatchReply::places() const
74{
75 Q_D(const QPlaceMatchReply);
76 return d->places;
77}
78
79/*!
80 Sets the list of matching \a places.
81*/
82void QPlaceMatchReply::setPlaces(const QList<QPlace> &places)
83{
84 Q_D(QPlaceMatchReply);
85 d->places = places;
86}
87
88/*!
89 Returns the match request that was used to generate this reply.
90*/
91QPlaceMatchRequest QPlaceMatchReply::request() const
92{
93 Q_D(const QPlaceMatchReply);
94 return d->request;
95}
96
97/*!
98 Sets the match \a request used to generate this reply.
99*/
100void QPlaceMatchReply::setRequest(const QPlaceMatchRequest &request)
101{
102 Q_D(QPlaceMatchReply);
103 d->request = request;
104}
QPlaceMatchRequest request
Combined button and popup list for selecting options.