Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qplacesearchresult_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 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
5
#
ifndef
QPLACESEARCHRESULT_P_H
6
#
define
QPLACESEARCHRESULT_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
"qplacesearchresult.h"
20
#
include
"qplacesearchrequest.h"
21
22
#
include
<
QSharedData
>
23
#
include
<
QtLocation
/
QPlaceIcon
>
24
25
QT_BEGIN_NAMESPACE
26
27
// defines must be in sync with class below
28
#
define
Q_IMPLEMENT_SEARCHRESULT_D_FUNC
(
Class
)
29
Class
##
Private
*
Class
::
d_func
(
)
{
return
reinterpret_cast
<
Class
##
Private
*
>
(
d_ptr
.
data
(
)
)
;
}
30
const
Class
##
Private
*
Class
::
d_func
(
)
const
{
return
reinterpret_cast
<
const
Class
##
Private
*
>
(
d_ptr
.
constData
(
)
)
;
}
31
32
#
define
Q_IMPLEMENT_SEARCHRESULT_COPY_CTOR
(
Class
)
33
Class
::
Class
(
const
QPlaceSearchResult
&
other
)
:
QPlaceSearchResult
(
)
{
Class
##
Private
::
copyIfPossible
(
d_ptr
,
other
)
;
}
34
35
#
define
Q_DEFINE_SEARCHRESULT_PRIVATE_HELPER
(
Class
,
ResultType
)
36
QPlaceSearchResultPrivate
*
clone
(
)
const
override
{
return
new
Class
##
Private
(
*
this
)
;
}
37
QPlaceSearchResult
::
SearchResultType
type
(
)
const
override
{
return
ResultType
;
}
38
static
void
copyIfPossible
(
QSharedDataPointer
<
QPlaceSearchResultPrivate
>
&
d_ptr
,
const
QPlaceSearchResult
&
other
)
39
{
40
if
(
other
.
type
(
)
==
ResultType
)
41
d_ptr
=
extract_d
(
other
)
;
42
else
43
d_ptr
=
new
Class
##
Private
;
44
}
45
46
class
QPlaceSearchResultPrivate :
public
QSharedData
47
{
48
public
:
49
QPlaceSearchResultPrivate() {}
50
virtual
~QPlaceSearchResultPrivate() {}
51
52
virtual
bool
compare(
const
QPlaceSearchResultPrivate *other)
const
;
53
54
static
const
QSharedDataPointer<QPlaceSearchResultPrivate>
55
&extract_d(
const
QPlaceSearchResult &other) {
return
other.d_ptr; }
56
57
virtual
QPlaceSearchResultPrivate *clone()
const
{
return
new
QPlaceSearchResultPrivate(*
this
); }
58
virtual
QPlaceSearchResult::SearchResultType type()
const
{
return
QPlaceSearchResult::UnknownSearchResult; }
59
static
void
copyIfPossible(QSharedDataPointer<QPlaceSearchResultPrivate> &d_ptr,
const
QPlaceSearchResult &other)
60
{
61
if
(other.type() == QPlaceSearchResult::UnknownSearchResult)
62
d_ptr = extract_d(other);
63
else
64
d_ptr =
new
QPlaceSearchResultPrivate;
65
}
66
67
QString title;
68
QPlaceIcon icon;
69
};
70
71
template
<> QPlaceSearchResultPrivate *QSharedDataPointer<QPlaceSearchResultPrivate>::clone();
72
73
QT_END_NAMESPACE
74
75
#
endif
// QPLACESEARCHRESULT_P_H
QPlaceProposedSearchResultPrivate
Definition
qplaceproposedsearchresult_p.h:25
QPlaceProposedSearchResultPrivate::compare
bool compare(const QPlaceSearchResultPrivate *other) const override
Definition
qplaceproposedsearchresult.cpp:11
QPlaceProposedSearchResult
\inmodule QtLocation
Definition
qplaceproposedsearchresult.h:15
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(QByteArrayView, Q_PRIMITIVE_TYPE)
Q_IMPLEMENT_SEARCHRESULT_D_FUNC
#define Q_IMPLEMENT_SEARCHRESULT_D_FUNC(Class)
Definition
qplacesearchresult_p.h:28
Q_IMPLEMENT_SEARCHRESULT_COPY_CTOR
#define Q_IMPLEMENT_SEARCHRESULT_COPY_CTOR(Class)
Definition
qplacesearchresult_p.h:32
Q_DEFINE_SEARCHRESULT_PRIVATE_HELPER
#define Q_DEFINE_SEARCHRESULT_PRIVATE_HELPER(Class, ResultType)
Definition
qplacesearchresult_p.h:35
qtlocation
src
location
places
qplacesearchresult_p.h
Generated on
for Qt by
1.18.0