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
qplaceidreply.cpp
Go to the documentation of this file.
1// Copyright (C) 2015 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
18
19QT_END_NAMESPACE
20
21QT_USE_NAMESPACE
22
23/*!
24 \class QPlaceIdReply
25 \inmodule QtLocation
26 \ingroup QtLocation-places
27 \ingroup QtLocation-places-replies
28 \since 5.6
29
30 \brief The QPlaceIdReply class manages operations which return an identifier such as
31 saving and removal operations of places and categories.
32
33 The QPlaceIdReply can be considered a multipurpose reply in that it can
34 be used to save places, save categories, remove places and remove categories.
35 In each case it returns an identifier of the place or category that was added, modified or removed.
36
37 See \l {Saving a place cpp}{Saving a place} for an example of how to use an identifier reply.
38 \sa QPlaceManager
39*/
40
41/*!
42 \enum QPlaceIdReply::OperationType
43 Defines the type of operation that was used to generate this reply.
44 \value SavePlace The reply was created for a save place operation
45 \value RemovePlace The reply was created for a remove place operation.
46 \value SaveCategory The reply was created for a save category operation
47 \value RemoveCategory The reply was created for a remove category operation.
48*/
49
50/*!
51 Constructs a reply which contains the identifier of the object operated upon. The reply is for the given \a operationType and with \a parent.
52*/
53QPlaceIdReply::QPlaceIdReply(QPlaceIdReply::OperationType operationType, QObject *parent)
54 : QPlaceReply(new QPlaceIdReplyPrivate(operationType), parent) {}
55
56/*!
57 Destroys the reply.
58*/
59QPlaceIdReply::~QPlaceIdReply()
60{
61}
62
63/*!
64 Returns the type of reply.
65*/
66QPlaceReply::Type QPlaceIdReply::type() const
67{
68 return QPlaceReply::IdReply;
69}
70
71/*!
72 Returns the operation type of the reply. This means whether this
73 identifier reply was for a save place operation,
74 remove category operation and so on.
75*/
76QPlaceIdReply::OperationType QPlaceIdReply::operationType() const
77{
78 Q_D(const QPlaceIdReply);
79 return d->operationType;
80}
81
82/*!
83 Returns the relevant identifier for the operation. For example for a save place operation,
84 the identifier is that of the saved place. For a category removal operation,
85 it is the identifier of the category that was removed.
86*/
87QString QPlaceIdReply::id() const
88{
89 Q_D(const QPlaceIdReply);
90 return d->id;
91}
92
93/*!
94 Sets the \a identifier of the reply.
95*/
96void QPlaceIdReply::setId(const QString &identifier)
97{
98 Q_D(QPlaceIdReply);
99 d->id = identifier;
100}
QPlaceIdReplyPrivate(QPlaceIdReply::OperationType operationType)
Combined button and popup list for selecting options.