• PySide 模块
  • PySide.QtHelp
  • 内容表

    上一话题

    QHelpSearchEngine

    下一话题

    QHelpEngine

    QHelpEngineCore

    继承者: QHelpEngine

    概要

    函数

    信号

    静态函数

    详细描述

    PySide.QtHelp.QHelpEngineCore class provides the core functionality of the help system.

    Before the help engine can be used, it must be initialized by calling PySide.QtHelp.QHelpEngineCore.setupData() . At the beginning of the setup process the signal PySide.QtHelp.QHelpEngineCore.setupStarted() is emitted. From this point on until the signal PySide.QtHelp.QHelpEngineCore.setupFinished() is emitted, is the help data in an undefined meaning unusable state.

    The core help engine can be used to perform different tasks. By calling PySide.QtHelp.QHelpEngineCore.linksForIdentifier() the engine returns urls specifying the file locations inside the help system. The actual file data can then be retrived by calling PySide.QtHelp.QHelpEngineCore.fileData() . In contrast to all other functions in this class, PySide.QtHelp.QHelpEngineCore.linksForIdentifier() depends on the currently set custom filter. Depending on the filter, the function may return different hits.

    Every help engine can contain any number of custom filters. A custom filter is defined by a name and set of filter attributes and can be added to the help engine by calling PySide.QtHelp.QHelpEngineCore.addCustomFilter() . Analogous, it is removed by calling PySide.QtHelp.QHelpEngineCore.removeCustomFilter() . PySide.QtHelp.QHelpEngineCore.customFilters() returns all defined filters.

    The help engine also offers the possibility to set and read values in a persistant way comparable to ini files or Windows registry entries. For more information see setValue() or value() .

    This class does not offer any GUI components or functionality for indices or contents. If you need one of those use PySide.QtHelp.QHelpEngine 代替。

    When creating a custom help viewer the viewer can be configured by writing a custom collection file which could contain various keywords to be used to configure the help engine. These keywords and values and their meaning can be found in the help information for creating a custom help collection file for Assistant.

    class PySide.QtHelp. QHelpEngineCore ( collectionFile [ , parent=None ] )
    参数:

    Constructs a new core help engine with a parent 。帮助引擎所用信息存储于 collectionFile to provide help. If the collection file does not exist yet, it'll be created.

    PySide.QtHelp.QHelpEngineCore. addCustomFilter ( filterName , attributes )
    参数:
    • filterName – unicode
    • attributes – list of strings
    返回类型:

    PySide.QtCore.bool

    Adds the new custom filter filterName . The filter attributes are specified by attributes . If the filter already exists, its attribute set is replaced. The function returns true if the operation succeeded, otherwise it returns false.

    PySide.QtHelp.QHelpEngineCore. autoSaveFilter ( )
    返回类型: PySide.QtCore.bool

    此特性保持是否 PySide.QtHelp.QHelpEngineCore is in auto save filter mode or not..

    PySide.QtHelp.QHelpEngineCore is in auto save filter mode, the current filter is automatically saved when it is changed by the PySide.QtHelp.QHelpEngineCore.setCurrentFilter() function. The filter is saved persistently in the help collection file.

    By default, this mode is on.

    PySide.QtHelp.QHelpEngineCore. collectionFile ( )
    返回类型: unicode

    This property holds the absolute file name of the collection file currently used..

    Setting this property leaves the help engine in an invalid state. It is important to invoke PySide.QtHelp.QHelpEngineCore.setupData() or any getter function in order to setup the help engine again.

    PySide.QtHelp.QHelpEngineCore. copyCollectionFile ( fileName )
    参数: fileName – unicode
    返回类型: PySide.QtCore.bool

    Creates the file fileName and copies all contents from the current collection file into the newly created file, and returns true if successful; otherwise returns false.

    The copying process makes sure that file references to Qt Collection files ( .qch ) files are updated accordingly.

    PySide.QtHelp.QHelpEngineCore. currentFilter ( )
    返回类型: unicode

    This property holds the name of the custom filter currently applied..

    Setting this property will save the new custom filter permanently in the help collection file. To set a custom filter without saving it permanently, disable the auto save filter mode.

    PySide.QtHelp.QHelpEngineCore. currentFilterChanged ( newFilter )
    参数: newFilter – unicode
    PySide.QtHelp.QHelpEngineCore. customFilters ( )
    返回类型: 字符串列表

    Returns a list of custom filters.

    PySide.QtHelp.QHelpEngineCore. customValue ( key [ , defaultValue=None ] )
    参数:
    • key – unicode
    • defaultValue – object
    返回类型:

    object

    Returns the value assigned to the key . If the requested key does not exist, the specified defaultValue 被返回。

    PySide.QtHelp.QHelpEngineCore. documentationFileName ( namespaceName )
    参数: namespaceName – unicode
    返回类型: unicode

    Returns the absolute file name of the Qt compressed help file (.qch) identified by the namespaceName . If there is no Qt compressed help file with the specified namespace registered, an empty string is returned.

    PySide.QtHelp.QHelpEngineCore. error ( )
    返回类型: unicode

    Returns a description of the last error that occurred.

    PySide.QtHelp.QHelpEngineCore. fileData ( url )
    参数: url PySide.QtCore.QUrl
    返回类型: PySide.QtCore.QByteArray

    Returns the data of the file specified by url . If the file does not exist, an empty PySide.QtCore.QByteArray 被返回。

    PySide.QtHelp.QHelpEngineCore. 文件 ( namespaceName , filterAttributes [ , extensionFilter="" ] )
    参数:
    • namespaceName – unicode
    • filterAttributes – list of strings
    • extensionFilter – unicode
    返回类型:

    Returns a list of files contained in the Qt compressed help file namespaceName . The files can be filtered by filterAttributes as well as by their extension extensionFilter (e.g. ‘html').

    PySide.QtHelp.QHelpEngineCore. filterAttributeSets ( namespaceName )
    参数: namespaceName – unicode
    返回类型:

    Returns a list of filter attributes for the different filter sections defined in the Qt compressed help file with the given namespace namespaceName .

    PySide.QtHelp.QHelpEngineCore. filterAttributes ( )
    返回类型: 字符串列表

    Returns a list of all defined filter attributes.

    PySide.QtHelp.QHelpEngineCore. filterAttributes ( filterName )
    参数: filterName – unicode
    返回类型: 字符串列表

    Returns a list of filter attributes used by the custom filter filterName .

    PySide.QtHelp.QHelpEngineCore. findFile ( url )
    参数: url PySide.QtCore.QUrl
    返回类型: PySide.QtCore.QUrl

    Returns an invalid URL if the file url cannot be found. If the file exists, either the same url is returned or a different url if the file is located in a different namespace which is merged via a common virtual folder.

    PySide.QtHelp.QHelpEngineCore. linksForIdentifier ( id )
    参数: id – unicode
    返回类型:

    Returns a map of hits found for the id . A hit contains the title of the document and the url where the keyword is located. The result depends on the current filter, meaning only the keywords registered for the current filter will be returned.

    static PySide.QtHelp.QHelpEngineCore. metaData ( documentationFileName , name )
    参数:
    • documentationFileName – unicode
    • name – unicode
    返回类型:

    object

    Returns the meta data for the Qt compressed help file documentationFileName . If there is no data available for name , an invalid QVariant() is returned. The meta data is defined when creating the Qt compressed help file and cannot be modified later. Common meta data includes e.g. the author of the documentation.

    static PySide.QtHelp.QHelpEngineCore. namespaceName ( documentationFileName )
    参数: documentationFileName – unicode
    返回类型: unicode

    Returns the namespace name defined for the Qt compressed help file (.qch) specified by its documentationFileName . If the file is not valid, an empty string is returned.

    PySide.QtHelp.QHelpEngineCore. registerDocumentation ( documentationFileName )
    参数: documentationFileName – unicode
    返回类型: PySide.QtCore.bool

    Registers the Qt compressed help file (.qch) contained in the file documentationFileName . One compressed help file, uniquely identified by its namespace can only be registered once. True is returned if the registration was successful, otherwise false.

    PySide.QtHelp.QHelpEngineCore. registeredDocumentations ( )
    返回类型: 字符串列表

    Returns a list of all registered Qt compressed help files of the current collection file. The returned names are the namespaces of the registered Qt compressed help files (.qch).

    PySide.QtHelp.QHelpEngineCore. removeCustomFilter ( filterName )
    参数: filterName – unicode
    返回类型: PySide.QtCore.bool

    Returns true if the filter filterName was removed successfully, otherwise false.

    PySide.QtHelp.QHelpEngineCore. removeCustomValue ( key )
    参数: key – unicode
    返回类型: PySide.QtCore.bool

    移除 key from the settings section in the collection file. Returns true if the value was removed successfully, otherwise false.

    PySide.QtHelp.QHelpEngineCore. setAutoSaveFilter ( save )
    参数: save PySide.QtCore.bool

    此特性保持是否 PySide.QtHelp.QHelpEngineCore is in auto save filter mode or not..

    PySide.QtHelp.QHelpEngineCore is in auto save filter mode, the current filter is automatically saved when it is changed by the PySide.QtHelp.QHelpEngineCore.setCurrentFilter() function. The filter is saved persistently in the help collection file.

    By default, this mode is on.

    PySide.QtHelp.QHelpEngineCore. setCollectionFile ( fileName )
    参数: fileName – unicode

    This property holds the absolute file name of the collection file currently used..

    Setting this property leaves the help engine in an invalid state. It is important to invoke PySide.QtHelp.QHelpEngineCore.setupData() or any getter function in order to setup the help engine again.

    PySide.QtHelp.QHelpEngineCore. setCurrentFilter ( filterName )
    参数: filterName – unicode

    This property holds the name of the custom filter currently applied..

    Setting this property will save the new custom filter permanently in the help collection file. To set a custom filter without saving it permanently, disable the auto save filter mode.

    PySide.QtHelp.QHelpEngineCore. setCustomValue ( key , value )
    参数:
    • key – unicode
    • value – object
    返回类型:

    PySide.QtCore.bool

    Save the value under the key . If the key already exist, the value will be overwritten. Returns true if the value was saved successfully, otherwise false.

    PySide.QtHelp.QHelpEngineCore. setupData ( )
    返回类型: PySide.QtCore.bool

    Sets up the help engine by processing the information found in the collection file and returns true if successful; otherwise returns false.

    By calling the function, the help engine is forced to initialize itself immediately. Most of the times, this function does not have to be called explicitly because getter functions which depend on a correctly set up help engine do that themselves.

    注意

    qsqlite4.dll needs to be deployed with the application as the help system uses the sqlite driver when loading help collections.

    PySide.QtHelp.QHelpEngineCore. setupFinished ( )
    PySide.QtHelp.QHelpEngineCore. setupStarted ( )
    PySide.QtHelp.QHelpEngineCore. unregisterDocumentation ( namespaceName )
    参数: namespaceName – unicode
    返回类型: PySide.QtCore.bool

    Unregisters the Qt compressed help file (.qch) identified by its namespaceName from the help collection. Returns true on success, otherwise false.

    PySide.QtHelp.QHelpEngineCore. warning ( msg )
    参数: msg – unicode