22
23
24
25
26
27
28
29
30
31
32
33
34
35
38
39
40
41
44
45
46
47
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
102
103
104
105
108
109
110
111
114
115
116
117
120
121
122
123
124
127
128
129
130
131
132
133QHelpSearchEngine::QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent)
135 , d(
new QHelpSearchEnginePrivate{QHelpSearchEngineCore(helpEngine)})
137 connect(&d->m_searchEngine, &QHelpSearchEngineCore::indexingStarted,
138 this, &QHelpSearchEngine::indexingStarted);
139 connect(&d->m_searchEngine, &QHelpSearchEngineCore::indexingFinished,
140 this, &QHelpSearchEngine::indexingFinished);
141 connect(&d->m_searchEngine, &QHelpSearchEngineCore::searchingStarted,
142 this, &QHelpSearchEngine::searchingStarted);
143 connect(&d->m_searchEngine, &QHelpSearchEngineCore::searchingFinished,
144 this, [
this] { emit searchingFinished(d->m_searchEngine.searchResultCount()); });
148
149
150QHelpSearchEngine::~QHelpSearchEngine()
156
157
158
159QHelpSearchQueryWidget* QHelpSearchEngine::queryWidget()
162 d->queryWidget =
new QHelpSearchQueryWidget();
163 return d->queryWidget;
167
168
169QHelpSearchResultWidget* QHelpSearchEngine::resultWidget()
171 if (!d->resultWidget)
172 d->resultWidget =
new QHelpSearchResultWidget(
this);
173 return d->resultWidget;
176#if QT_DEPRECATED_SINCE(5
, 9
)
178
179
180
181int QHelpSearchEngine::hitsCount()
const
183 return searchResultCount();
187
188
189
190
191int QHelpSearchEngine::hitCount()
const
193 return searchResultCount();
198
199
200
201int QHelpSearchEngine::searchResultCount()
const
203 return d->m_searchEngine.searchResultCount();
206#if QT_DEPRECATED_SINCE(5
, 9
)
208
209
210
211
212
213
214
215
216
217
220
221
222
223QList<QHelpSearchEngine::SearchHit> QHelpSearchEngine::hits(
int start,
int end)
const
225 QList<QHelpSearchEngine::SearchHit> hits;
226 for (
const QHelpSearchResult &result : searchResults(start, end))
227 hits.append(qMakePair(result.url().toString(), result.title()));
233
234
235
236
237QList<QHelpSearchResult> QHelpSearchEngine::searchResults(
int start,
int end)
const
239 return d->m_searchEngine.searchResults(start, end);
243
244
245
246QString QHelpSearchEngine::searchInput()
const
248 return d->m_searchEngine.searchInput();
251#if QT_DEPRECATED_SINCE(5
, 9
)
253QT_WARNING_DISABLE_DEPRECATED
255
256
257
258
259QList<QHelpSearchQuery> QHelpSearchEngine::query()
const
261 return {{QHelpSearchQuery::DEFAULT, searchInput().split(QChar::Space)}};
267
268
269void QHelpSearchEngine::reindexDocumentation()
271 d->m_searchEngine.reindexDocumentation();
275
276
277void QHelpSearchEngine::cancelIndexing()
279 d->m_searchEngine.cancelIndexing();
283
284
285void QHelpSearchEngine::cancelSearching()
287 d->m_searchEngine.cancelSearching();
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307void QHelpSearchEngine::search(
const QString &searchInput)
309 d->m_searchEngine.search(searchInput);
312#if QT_DEPRECATED_SINCE(5
, 9
)
314
315
316
317void QHelpSearchEngine::search(
const QList<QHelpSearchQuery> &queryList)
319 if (queryList.isEmpty())
322 d->m_searchEngine.search(queryList.first().wordList.join(QChar::Space));
327
328
329void QHelpSearchEngine::scheduleIndexDocumentation()
331 d->m_searchEngine.scheduleIndexDocumentation();
335void QHelpSearchEngine::indexDocumentation()
QHelpSearchResultWidget * resultWidget
QHelpSearchQueryWidget * queryWidget
QHelpSearchEngineCore m_searchEngine
Combined button and popup list for selecting options.