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
qhelpfilterdata.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 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
6
7#include <QtCore/qversionnumber.h>
8
10
24
25/*!
26 \class QHelpFilterData
27 \since 5.13
28 \inmodule QtHelp
29 \brief The QHelpFilterData class provides details for the filters
30 used by QHelpFilterEngine.
31
32 By using setComponents() you may constrain the search results to
33 documents that belong only to components specified on the given list.
34 By using setVersions() you may constrain the search results to
35 documents that belong only to versions specified on the given list.
36
37 \sa QHelpFilterEngine
38*/
39
40/*!
41 Constructs the empty filter.
42*/
43QHelpFilterData::QHelpFilterData() : d(new QHelpFilterDataPrivate) { }
44
45/*!
46 Constructs a copy of \a other.
47*/
48QHelpFilterData::QHelpFilterData(const QHelpFilterData &) = default;
49
50/*!
51 Move-constructs a QHelpFilterData instance, making it point at the same object that \a other was pointing to.
52*/
53QHelpFilterData::QHelpFilterData(QHelpFilterData &&) = default;
54
55/*!
56 Destroys the filter.
57*/
58QHelpFilterData::~QHelpFilterData() = default;
59
60/*!
61 Assigns \a other to this filter and returns a reference to this filter.
62*/
63QHelpFilterData &QHelpFilterData::operator=(const QHelpFilterData &) = default;
64
65/*!
66 Move-assigns \a other to this QHelpFilterData instance.
67*/
68QHelpFilterData &QHelpFilterData::operator=(QHelpFilterData &&) = default;
69
70/*!
71 \fn void QHelpFilterData::swap(QHelpFilterData &other)
72
73 Swaps the filter \a other with this filter. This
74 operation is very fast and never fails.
75*/
76
77bool QHelpFilterData::operator==(const QHelpFilterData &other) const
78{
79 return (d->m_components == other.d->m_components && d->m_versions == other.d->m_versions);
80}
81
82/*!
83 Specifies the component list that is used for filtering
84 the search results. Only results from components in the list
85 \a components shall be returned.
86*/
87void QHelpFilterData::setComponents(const QStringList &components)
88{
89 d->m_components = components;
90}
91
92/*!
93 Specifies the version list that is used for filtering
94 the search results. Only results from versions in the list
95 \a versions shall be returned.
96*/
97void QHelpFilterData::setVersions(const QList<QVersionNumber> &versions)
98{
99 d->m_versions = versions;
100}
101
102/*!
103 Returns the component list that is used for filtering
104 the search results.
105*/
106QStringList QHelpFilterData::components() const
107{
108 return d->m_components;
109}
110
111/*!
112 Returns the version list that is used for filtering
113 the search results.
114*/
115QList<QVersionNumber> QHelpFilterData::versions() const
116{
117 return d->m_versions;
118}
119
120QT_END_NAMESPACE
QHelpFilterDataPrivate(const QHelpFilterDataPrivate &other)
QList< QVersionNumber > m_versions
QHelpFilterDataPrivate()=default
Combined button and popup list for selecting options.