The PySide.QtHelp.QHelpSearchEngine class provides access to widgets reusable to integrate fulltext search as well as to index and search documentation.
Before the search engine can be used, one has to instantiate at least a PySide.QtHelp.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 PySide.QtHelp.QHelpSearchEngine.indexingStarted() is emitted and on the end of the indexing process the PySide.QtHelp.QHelpSearchEngine.indexingFinished() is emitted. To stop the indexing one can call PySide.QtHelp.QHelpSearchEngine.cancelIndexing() .
While the indexing process has finished, the search engine can now be used to search thru its index for a given term. To do this one may use the possibility of creating the PySide.QtHelp.QHelpSearchQuery list by self or reuse the PySide.QtHelp.QHelpSearchQueryWidget which has the inbuild functionality to set up a proper search queries list that get’s passed to the search engines PySide.QtHelp.QHelpSearchEngine.search() function.
After the list of querys has been passed to the search engine, the signal PySide.QtHelp.QHelpSearchEngine.searchingStarted() is emitted and after the search has finished the PySide.QtHelp.QHelpSearchEngine.searchingFinished() signal is emitted. The search process can be stopped by calling PySide.QtHelp.QHelpSearchEngine.cancelSearching() .
If the search succeeds, the PySide.QtHelp.QHelpSearchEngine.searchingFinished() will be called with the search hits count, which can be reused to fetch the search hits from the search engine. Calling the PySide.QtHelp.QHelpSearchEngine.hits() function with the range of hits you would like to get will return a list of the requested SearchHits. They basically constist at the moment of a pair of strings where the values of that pair are the documentation file path and the page title.
To display the given hits use the PySide.QtHelp.QHelpSearchResultWidget or build up your own one if you need more advanced functionality. Note that the PySide.QtHelp.QHelpSearchResultWidget 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.
Parameters: |
|
---|
Constructs a new search engine with the given parent . The search engine uses the given helpEngine to access the documentation that needs to be indexed. The PySide.QtHelp.QHelpEngine ‘s setupFinished() signal is automatically connected to the PySide.QtHelp.QHelpSearchEngine ‘s indexing function, so that new documentation will be indexed after the signal is emitted.
Stops the indexing process.
Stops the search process.
Return type: | PySide.QtCore.int |
---|
Returns the amount of hits the search engine found.
Parameters: |
|
---|---|
Return type: |
Returns a list of search hits within the range of startend .
Return type: | PySide.QtCore.int |
---|
Returns the amount of hits the search engine found.
Return type: |
---|
Returns the list of queries last searched for.
Return type: | PySide.QtHelp.QHelpSearchQueryWidget |
---|
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.
Forces the search engine to reindex all documentation files.
Return type: | PySide.QtHelp.QHelpSearchResultWidget |
---|
Returns a widget that can hold and display the search results.
Parameters: | queryList – |
---|
Parameters: | hits – PySide.QtCore.int |
---|