QHelpSearchEngine

Synopsis

Functions

Slots

Signals

Detailed Description

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 queries have 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.

class PySide.QtHelp.QHelpSearchEngine(helpEngine[, parent=None])
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.

PySide.QtHelp.QHelpSearchEngine.cancelIndexing()

Stops the indexing process.

PySide.QtHelp.QHelpSearchEngine.cancelSearching()

Stops the search process.

PySide.QtHelp.QHelpSearchEngine.hitCount()
Return type:PySide.QtCore.int

Returns the amount of hits the search engine found.

PySide.QtHelp.QHelpSearchEngine.hits(start, end)
Parameters:
  • startPySide.QtCore.int
  • endPySide.QtCore.int
Return type:

Returns a list of search hits within the range of startend .

PySide.QtHelp.QHelpSearchEngine.hitsCount()
Return type:PySide.QtCore.int

Returns the amount of hits the search engine found.

PySide.QtHelp.QHelpSearchEngine.indexDocumentation()
PySide.QtHelp.QHelpSearchEngine.indexingFinished()
PySide.QtHelp.QHelpSearchEngine.indexingStarted()
PySide.QtHelp.QHelpSearchEngine.query()
Return type:

Returns the list of queries last searched for.

PySide.QtHelp.QHelpSearchEngine.queryWidget()
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.

PySide.QtHelp.QHelpSearchEngine.reindexDocumentation()

Forces the search engine to reindex all documentation files.

PySide.QtHelp.QHelpSearchEngine.resultWidget()
Return type:PySide.QtHelp.QHelpSearchResultWidget

Returns a widget that can hold and display the search results.

PySide.QtHelp.QHelpSearchEngine.search(queryList)
Parameters:queryList
PySide.QtHelp.QHelpSearchEngine.searchingFinished(hits)
Parameters:hitsPySide.QtCore.int
PySide.QtHelp.QHelpSearchEngine.searchingStarted()