QHelpSearchEngine¶
The
QHelpSearchEngine
class provides access to widgets reusable to integrate fulltext search as well as to index and search documentation. More…
Synopsis¶
Functions¶
def
hitCount
()def
hits
(start, end)def
hitsCount
()def
query
()def
queryWidget
()def
resultWidget
()def
searchInput
()def
searchResultCount
()def
searchResults
(start, end)
Slots¶
def
cancelIndexing
()def
cancelSearching
()def
reindexDocumentation
()def
scheduleIndexDocumentation
()def
search
(queryList)def
search
(searchInput)
Signals¶
def
indexingFinished
()def
indexingStarted
()def
searchingFinished
(searchResultCount)def
searchingStarted
()
Detailed Description¶
Before the search engine can be used, one has to instantiate at least a
QHelpEngineCore
object that needs to be passed to the search engines constructor. This is required as the search engine needs to be connected to the help engines setupFinished() signal to know when it can start to index documentation.After starting the indexing process the signal
indexingStarted()
is emitted and on the end of the indexing process theindexingFinished()
is emitted. To stop the indexing one can callcancelIndexing()
.When the indexing process has finished, the search engine can be used to search through the index for a given term using the
search()
function. When the search input is passed to the search engine, thesearchingStarted()
signal is emitted. When the search finishes, thesearchingFinished()
signal is emitted. The search process can be stopped by callingcancelSearching()
.If the search succeeds,
searchingFinished()
is called with the search result count to fetch the search results from the search engine. Calling thesearchResults()
function with a range returns a list ofQHelpSearchResult
objects within the range. The results consist of the document title and URL, as well as a snippet from the document that contains the best match for the search input.To display the given search results use the
QHelpSearchResultWidget
or build up your own one if you need more advanced functionality. Note that theQHelpSearchResultWidget
can not be instantiated directly, you must retrieve the widget from the search engine in use as all connections will be established for you by the widget itself.
- class PySide2.QtHelp.QHelpSearchEngine(helpEngine[, parent=None])¶
- param parent:
- param helpEngine:
Constructs a new search engine with the given
parent
. The search engine uses the givenhelpEngine
to access the documentation that needs to be indexed. TheQHelpEngine
‘s setupFinished() signal is automatically connected to theQHelpSearchEngine
‘s indexing function, so that new documentation will be indexed after the signal is emitted.
- PySide2.QtHelp.QHelpSearchEngine.cancelIndexing()¶
Stops the indexing process.
- PySide2.QtHelp.QHelpSearchEngine.cancelSearching()¶
Stops the search process.
- PySide2.QtHelp.QHelpSearchEngine.hitCount()¶
- Return type:
int
Note
This function is deprecated.
Use
searchResultCount()
instead.
- PySide2.QtHelp.QHelpSearchEngine.hits(start, end)¶
- Parameters:
start – int
end – int
- Return type:
Note
This function is deprecated.
Use
searchResults()
instead.
- PySide2.QtHelp.QHelpSearchEngine.hitsCount()¶
- Return type:
int
Note
This function is deprecated.
Use
searchResultCount()
instead.
- PySide2.QtHelp.QHelpSearchEngine.indexingFinished()¶
- PySide2.QtHelp.QHelpSearchEngine.indexingStarted()¶
- PySide2.QtHelp.QHelpSearchEngine.query()¶
- Return type:
Note
This function is deprecated.
Use
searchInput()
instead.
- PySide2.QtHelp.QHelpSearchEngine.queryWidget()¶
- Return type:
Returns a widget to use as input widget. Depending on your search engine configuration you will get a different widget with more or less subwidgets.
- PySide2.QtHelp.QHelpSearchEngine.reindexDocumentation()¶
Forces the search engine to reindex all documentation files.
- PySide2.QtHelp.QHelpSearchEngine.resultWidget()¶
- Return type:
Returns a widget that can hold and display the search results.
- PySide2.QtHelp.QHelpSearchEngine.scheduleIndexDocumentation()¶
- PySide2.QtHelp.QHelpSearchEngine.search(queryList)¶
- Parameters:
queryList –
Note
This function is deprecated.
- PySide2.QtHelp.QHelpSearchEngine.search(searchInput)
- Parameters:
searchInput – str
- PySide2.QtHelp.QHelpSearchEngine.searchInput()¶
- Return type:
str
Returns the phrase that was last searched for.
- PySide2.QtHelp.QHelpSearchEngine.searchResultCount()¶
- Return type:
int
Returns the number of results the search engine found.
- PySide2.QtHelp.QHelpSearchEngine.searchResults(start, end)¶
- Parameters:
start – int
end – int
- Return type:
Returns a list of search results within the range from the index specified by
start
to the index specified byend
.
- PySide2.QtHelp.QHelpSearchEngine.searchingFinished(searchResultCount)¶
- Parameters:
searchResultCount – int
- PySide2.QtHelp.QHelpSearchEngine.searchingStarted()¶
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.