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
4#ifndef QHELPSEARCHENGINE_H
5#define QHELPSEARCHENGINE_H
6
7#include <QtHelp/qhelp_global.h>
8#include <QtHelp/qhelpsearchresult.h>
9
10#include <QtCore/qobject.h>
11#include <QtCore/qshareddata.h>
12#include <QtCore/qstringlist.h>
13
15
16class QHelpEngineCore;
18class QHelpSearchQueryWidget;
19class QHelpSearchResultWidget;
20
21#if QT_DEPRECATED_SINCE(6, 7)
22class QHELP_EXPORT QHelpSearchQuery
23{
24public:
25 enum FieldName { DEFAULT = 0, FUZZY, WITHOUT, PHRASE, ALL, ATLEAST };
26
27 QT_DEPRECATED_VERSION_X_6_7("Use QString instead")
28 QHelpSearchQuery()
29 : fieldName(DEFAULT) { wordList.clear(); }
30 QT_DEPRECATED_VERSION_X_6_7("Use QString instead")
31 QHelpSearchQuery(FieldName field, const QStringList &wordList_)
32 : fieldName(field), wordList(wordList_) {}
33
34 FieldName fieldName;
35 QStringList wordList;
36};
37#endif // QT_DEPRECATED_SINCE(6, 7)
38
39class QHELP_EXPORT QHelpSearchEngine : public QObject
40{
41 Q_OBJECT
42
43public:
44 explicit QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent = nullptr);
45 ~QHelpSearchEngine();
46
47 QHelpSearchQueryWidget *queryWidget();
48 QHelpSearchResultWidget *resultWidget();
49
50#if QT_DEPRECATED_SINCE(5, 9)
51 typedef QPair<QString, QString> SearchHit;
52
53 QT_DEPRECATED int hitsCount() const;
54 QT_DEPRECATED int hitCount() const;
55 QT_DEPRECATED QList<SearchHit> hits(int start, int end) const;
56 QT_DEPRECATED QList<QHelpSearchQuery> query() const;
57#endif
58
59 int searchResultCount() const;
60 QList<QHelpSearchResult> searchResults(int start, int end) const;
61 QString searchInput() const;
62
63public Q_SLOTS:
64 void reindexDocumentation();
65 void cancelIndexing();
66
67#if QT_DEPRECATED_SINCE(5, 9)
68 QT_DEPRECATED void search(const QList<QHelpSearchQuery> &queryList);
69#endif
70
71 void search(const QString &searchInput);
72 void cancelSearching();
73
74 void scheduleIndexDocumentation();
75
76Q_SIGNALS:
77 void indexingStarted();
78 void indexingFinished();
79
80 void searchingStarted();
81 void searchingFinished(int searchResultCount);
82
83private Q_SLOTS:
84 void indexDocumentation();
85
86private:
87 QHelpSearchEnginePrivate *d;
88};
89
90QT_END_NAMESPACE
91
92#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:19
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:189
\inmodule QtCore
Combined button and popup list for selecting options.