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
qhelpsearchresult.cpp
Go to the documentation of this file.
1
// Copyright (C) 2024 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
#
include
"qhelpsearchresult.h"
6
7
#
include
<
QtCore
/
qstring
.
h
>
8
#
include
<
QtCore
/
qurl
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
class
QHelpSearchResultData
:
public
QSharedData
13
{
14
public
:
15
QUrl
m_url
;
16
QString
m_title
;
17
QString
m_snippet
;
18
};
19
20
/*!
21
\class QHelpSearchResult
22
\since 5.9
23
\inmodule QtHelp
24
\brief The QHelpSearchResult class provides the data associated with the
25
search result.
26
27
The QHelpSearchResult object is a data object that describes a single search result.
28
The vector of search result objects is returned by QHelpSearchEngine::searchResults().
29
The description of the search result contains the document title and URL
30
that the search input matched. It also contains the snippet from
31
the document content containing the best match of the search input.
32
\sa QHelpSearchEngine
33
*/
34
35
/*!
36
Constructs a new empty QHelpSearchResult.
37
*/
38
QHelpSearchResult::QHelpSearchResult() : d(
new
QHelpSearchResultData) { }
39
40
/*!
41
Constructs a copy of \a other.
42
*/
43
QHelpSearchResult::QHelpSearchResult(
const
QHelpSearchResult &other) =
default
;
44
45
/*!
46
Constructs the search result containing \a url, \a title and \a snippet
47
as the description of the result.
48
*/
49
QHelpSearchResult::QHelpSearchResult(
const
QUrl &url,
const
QString &title,
const
QString &snippet)
50
: d(
new
QHelpSearchResultData)
51
{
52
d->m_url = url;
53
d->m_title = title;
54
d->m_snippet = snippet;
55
}
56
57
/*!
58
Destroys the search result.
59
*/
60
QHelpSearchResult::~QHelpSearchResult() =
default
;
61
62
/*!
63
Assigns \a other to this search result and returns a reference to this search result.
64
*/
65
QHelpSearchResult &QHelpSearchResult::operator=(
const
QHelpSearchResult &other) =
default
;
66
67
/*!
68
Returns the document title of the search result.
69
*/
70
QString QHelpSearchResult::title()
const
71
{
72
return
d->m_title;
73
}
74
75
/*!
76
Returns the document URL of the search result.
77
*/
78
QUrl QHelpSearchResult::url()
const
79
{
80
return
d->m_url;
81
}
82
83
/*!
84
Returns the document snippet containing the search phrase of the search result.
85
*/
86
QString QHelpSearchResult::snippet()
const
87
{
88
return
d->m_snippet;
89
}
90
91
QT_END_NAMESPACE
QHelpSearchResultData
Definition
qhelpsearchresult.cpp:13
QHelpSearchResultData::m_url
QUrl m_url
Definition
qhelpsearchresult.cpp:15
QHelpSearchResultData::m_snippet
QString m_snippet
Definition
qhelpsearchresult.cpp:17
QHelpSearchResultData::m_title
QString m_title
Definition
qhelpsearchresult.cpp:16
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qttools
src
assistant
help
qhelpsearchresult.cpp
Generated on
for Qt by
1.18.0