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
qhelpsearchengine.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QHELPSEARCHENGINE_H
6#define QHELPSEARCHENGINE_H
7
8#include <QtHelp/qhelp_global.h>
9#include <QtHelp/qhelpsearchresult.h>
10
11#include <QtCore/qobject.h>
12#include <QtCore/qshareddata.h>
13#include <QtCore/qstringlist.h>
14
16
17class QHelpEngineCore;
19class QHelpSearchQueryWidget;
20class QHelpSearchResultWidget;
21
22#if QT_DEPRECATED_SINCE(6, 7)
23class QHELP_EXPORT QHelpSearchQuery
24{
25public:
26 enum FieldName { DEFAULT = 0, FUZZY, WITHOUT, PHRASE, ALL, ATLEAST };
27
28 QT_DEPRECATED_VERSION_X_6_7("Use QString instead")
29 QHelpSearchQuery()
30 : fieldName(DEFAULT) { wordList.clear(); }
31 QT_DEPRECATED_VERSION_X_6_7("Use QString instead")
32 QHelpSearchQuery(FieldName field, const QStringList &wordList_)
33 : fieldName(field), wordList(wordList_) {}
34
35 FieldName fieldName;
36 QStringList wordList;
37};
38#endif // QT_DEPRECATED_SINCE(6, 7)
39
40class QHELP_EXPORT QHelpSearchEngine : public QObject
41{
42 Q_OBJECT
43
44public:
45 explicit QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent = nullptr);
46 ~QHelpSearchEngine();
47
48 QHelpSearchQueryWidget *queryWidget();
49 QHelpSearchResultWidget *resultWidget();
50
51#if QT_DEPRECATED_SINCE(5, 9)
52 typedef QPair<QString, QString> SearchHit;
53
54 QT_DEPRECATED int hitsCount() const;
55 QT_DEPRECATED int hitCount() const;
56 QT_DEPRECATED QList<SearchHit> hits(int start, int end) const;
57 QT_DEPRECATED QList<QHelpSearchQuery> query() const;
58#endif
59
60 int searchResultCount() const;
61 QList<QHelpSearchResult> searchResults(int start, int end) const;
62 QString searchInput() const;
63
64public Q_SLOTS:
65 void reindexDocumentation();
66 void cancelIndexing();
67
68#if QT_DEPRECATED_SINCE(5, 9)
69 QT_DEPRECATED void search(const QList<QHelpSearchQuery> &queryList);
70#endif
71
72 void search(const QString &searchInput);
73 void cancelSearching();
74
75 void scheduleIndexDocumentation();
76
77Q_SIGNALS:
78 void indexingStarted();
79 void indexingFinished();
80
81 void searchingStarted();
82 void searchingFinished(int searchResultCount);
83
84private Q_SLOTS:
85 void indexDocumentation();
86
87private:
88 QHelpSearchEnginePrivate *d;
89};
90
91QT_END_NAMESPACE
92
93#endif // QHELPSEARCHENGINE_H
QHelpSearchEngine * searchEngine
QHelpIndexWidget * indexWidget
QHelpContentModel * contentModel
QHelpEnginePrivate(QHelpEngineCore *helpEngineCore)
QHelpEngineCore * m_helpEngineCore
bool m_isApplyCurrentFilterScheduled
QHelpIndexModel * indexModel
QHelpContentWidget * contentWidget
The QHelpEngine class provides access to contents and indices of the help engine.
Definition qhelpengine.h:20
The QHelpFilterEngine class provides a filtered view of the help contents.
The QHelpIndexModel class provides a model that supplies index keywords to views.
\inmodule QtHelp
The QHelpSearchEngine class provides access to widgets reusable to integrate fulltext search as well ...
Definition qmap.h:295
\inmodule QtCore
Combined button and popup list for selecting options.