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