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
qplacesearchresult.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
6#include "qplaceresult.h"
7#include <QtCore/qnumeric.h>
8
10
12{
13 return d->clone();
14}
15
16inline QPlaceSearchResultPrivate *QPlaceSearchResult::d_func()
17{
18 return static_cast<QPlaceSearchResultPrivate *>(d_ptr.data());
19}
20
21inline const QPlaceSearchResultPrivate *QPlaceSearchResult::d_func() const
22{
23 return static_cast<const QPlaceSearchResultPrivate *>(d_ptr.constData());
24}
25
27{
28 return title == other->title
29 && icon == other->icon;
30}
31
76
84
91
97{
98 if (this == &other)
99 return *this;
100
101 d_ptr = other.d_ptr;
102 return *this;
103}
104
110{
111 // An unknown object is only equal to another unknown search result
112 if (!d_ptr)
113 return !other.d_ptr;
114
115 if (type() != other.type())
116 return false;
117
118 return d_ptr->compare(other.d_ptr);
119}
120
136
142{
143 Q_D(const QPlaceSearchResult);
144 return d->title;
145}
146
151{
153 d->title = title;
154}
155
160{
161 Q_D(const QPlaceSearchResult);
162 return d->icon;
163}
164
169{
171 d->icon = icon;
172}
173
\inmodule QtLocation
Definition qplaceicon.h:23
virtual bool compare(const QPlaceSearchResultPrivate *other) const
virtual QPlaceSearchResult::SearchResultType type() const
\inmodule QtLocation
QSharedDataPointer< QPlaceSearchResultPrivate > d_ptr
void setTitle(const QString &title)
Sets the title of the search result to title.
void setIcon(const QPlaceIcon &icon)
Sets the icon of the search result to icon.
QString title() const
Returns the title of the search result.
virtual ~QPlaceSearchResult()
Destroys the search result.
SearchResultType
Defines the type of search result.
QPlaceSearchResult & operator=(const QPlaceSearchResult &other)
Assigns other to this search result and returns a reference to this search result.
SearchResultType type() const
Returns the result type.
bool operator==(const QPlaceSearchResult &other) const
Returns true if other is equal to this search result, otherwise returns false.
QPlaceSearchResult()
Constructs a new search result.
QPlaceIcon icon() const
Returns an icon that can be used to represent the search result.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString title
[35]
QSharedPointer< T > other(t)
[5]