QHelpFilterEngine 类

QHelpFilterEngine 类提供帮助内容的过滤视图。 更多...

头: #include <QHelpFilterEngine>
CMake: find_package(Qt6 COMPONENTS Help REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Help)
qmake: QT += help
Since: Qt 5.13
继承: QObject

公共函数

QString activeFilter () const
QStringList availableComponents () const
QList<QVersionNumber> availableVersions () const
QHelpFilterData filterData (const QString & filterName ) const
QStringList 过滤 () const
QStringList indices () const
QStringList indices (const QString & filterName ) const
QMap<QString, QString> namespaceToComponent () const
QMap<QString, QVersionNumber> namespaceToVersion () const
QStringList namespacesForFilter (const QString & filterName ) const
bool removeFilter (const QString & filterName )
bool setActiveFilter (const QString & filterName )
bool setFilterData (const QString & filterName , const QHelpFilterData & filterData )

信号

void filterActivated (const QString & newFilter )

详细描述

The filter engine allows the management of filters associated with a QHelpEngineCore instance. The help engine internally creates an instance of the filter engine, which can be accessed by calling QHelpEngineCore::filterEngine (). Therefore, the public constructor of this class is disabled.

The filters are identified by a filter name string. Filter details are described by the QHelpFilterData 类。

The filter engine allows for adding new filters and changing the existing filters' data through the setFilterData () method. An existing filter can be removed through the removeFilter () 方法。

Out of the registered filters one can be marked as the active one. The active filter will be used by the associated help engine for returning filtered results of many different functions, such as content, index, or search results. If no filter is marked active, the help engine returns the full results list available.

The active filter is returned by activeFilter () and it can be changed by setActiveFilter ().

另请参阅 QHelpEngineCore .

成员函数文档编制

[signal] void QHelpFilterEngine:: filterActivated (const QString & newFilter )

This signal is emitted when the active filter is set. newFilter specifies the name of the filter.

另请参阅 setActiveFilter ().

QString QHelpFilterEngine:: activeFilter () const

Returns the name of the currently active filter.

另请参阅 setActiveFilter ().

QStringList QHelpFilterEngine:: availableComponents () const

Returns the list of all available components defined in all registered documentation files.

[since 5.15] QList < QVersionNumber > QHelpFilterEngine:: availableVersions () const

Returns the list of all available versions defined in all registered documentation files.

该函数在 Qt 5.15 引入。

QHelpFilterData QHelpFilterEngine:: filterData (const QString & filterName ) const

Returns the filter details associated with filterName .

另请参阅 setFilterData ().

QStringList QHelpFilterEngine:: 过滤 () const

Returns the list of all filter names defined inside the filter engine.

[since 5.15] QStringList QHelpFilterEngine:: indices () const

Returns a sorted list of available indices. The returned list contents depend on the active filter, and therefore only the indices registered for the active filter will be returned.

该函数在 Qt 5.15 引入。

[since 5.15] QStringList QHelpFilterEngine:: indices (const QString & filterName ) const

Returns a sorted list of available indices, filtered by filterName . The returned list contents depend on the passed filter, and therefore only the indices registered for this filter will be returned. If you want to get all available indices unfiltered, pass empty string as filterName .

该函数在 Qt 5.15 引入。

QMap < QString , QString > QHelpFilterEngine:: namespaceToComponent () const

Returns the map of all the available namespaces as keys together with their associated components as values.

QMap < QString , QVersionNumber > QHelpFilterEngine:: namespaceToVersion () const

Returns the map of all the available namespaces as keys together with their associated versions as values.

QStringList QHelpFilterEngine:: namespacesForFilter (const QString & filterName ) const

Returns the list of all registered documentation namespaces that match the filter identified by filterName .

bool QHelpFilterEngine:: removeFilter (const QString & filterName )

Removes the filter identified by filterName .

返回 true if removing the filter succeeded, otherwise returns false .

bool QHelpFilterEngine:: setActiveFilter (const QString & filterName )

Changes the currently active filter to filterName .

返回 true if changing the filter succeeded, otherwise returns false .

另请参阅 activeFilter ().

bool QHelpFilterEngine:: setFilterData (const QString & filterName , const QHelpFilterData & filterData )

Changes the existing filter details of the filter identified by filterName to filterData . If the filter does not exist, a new filter is created.

返回 true if setting the filter succeeded, otherwise returns false .

另请参阅 filterData ().