ItemModelBarDataProxy QML Type

Proxy class for presenting data in item models with Bars3D . 更多...

import 语句: import QtGraphs
在 C++: QItemModelBarDataProxy
继承:

BarDataProxy

特性

信号

详细描述

This type allows you to use AbstractItemModel derived models as a data source for Bars3D .

Data is resolved asynchronously whenever the mapping or the model changes. QBarDataProxy::arrayReset () is emitted when the data has been resolved.

For ItemModelBarDataProxy enums, see QItemModelBarDataProxy::MultiMatchBehavior .

更多细节,见 QItemModelBarDataProxy 文档编制。

用法范例:

ItemModelBarDataProxy {
    itemModel: model // E.g. a list model defined elsewhere containing yearly expenses data.
    // Mapping model roles to bar series rows, columns, and values.
    rowRole: "year"
    columnRole: "city"
    valueRole: "expenses"
    rowCategories: ["2020", "2021", "2022", "2023"]
    columnCategories: ["Oulu", "Rauma", "Helsinki", "Tampere"]
}
					

另请参阅 BarDataProxy and Qt Graphs Data Handling with 3D .

特性文档编制

autoColumnCategories : bool

当设为 true , the mapping ignores any explicitly set column categories and overwrites them with automatically generated ones whenever the data from model is resolved. Defaults to true .

autoRowCategories : bool

当设为 true , the mapping ignores any explicitly set row categories and overwrites them with automatically generated ones whenever the data from the model is resolved. Defaults to true .

columnCategories : list < 字符串 >

The column categories of the mapping. Only items with column role values that are found in this list are included when the data is resolved. The columns are ordered in the same order as they are in this list.

columnRole : string

The item model role to map into column category.

columnRolePattern : regExp

When set, a search and replace is done on the value mapped by column role before it is used as a column category. This property specifies the regular expression to find the portion of the mapped value to replace and columnRoleReplace property contains the replacement string. This is useful for example in parsing row and column categories from a single timestamp field in the item model.

另请参阅 columnRole and columnRoleReplace .

columnRoleReplace : string

This property defines the replacement content to be used in conjunction with columnRolePattern . Defaults to empty string. For more information on how the search and replace using regular expressions works, see QString::replace (const QRegularExpression &rx, const QString &after) function documentation.

另请参阅 columnRole and columnRolePattern .

itemModel : model

The item model.

multiMatchBehavior : enumeration

Defines how multiple matches for each row/column combination are handled. Defaults to ItemModelBarDataProxy.MultiMatchBehavior.Last . The chosen behavior affects both bar value and rotation.

For example, you might have an item model with timestamped data taken at irregular intervals and you want to visualize total value of data items on each day with a bar graph. This can be done by specifying row and column categories so that each bar represents a day, and setting multiMatchBehavior to ItemModelBarDataProxy.MultiMatchBehavior.Cumulative .

rotationRole : string

The item model role to map into bar rotation angle.

rotationRolePattern : regExp

When set, a search and replace is done on the value mapped by rotation role before it is used as a bar rotation angle. This property specifies the regular expression to find the portion of the mapped value to replace and rotationRoleReplace property contains the replacement string.

另请参阅 rotationRole and rotationRoleReplace .

rotationRoleReplace : string

This property defines the replacement content to be used in conjunction with rotationRolePattern . Defaults to empty string. For more information on how the search and replace using regular expressions works, see QString::replace (const QRegularExpression &rx, const QString &after) function documentation.

另请参阅 rotationRole and rotationRolePattern .

rowCategories : list < 字符串 >

The row categories of the mapping. Only items with row role values that are found in this list are included when the data is resolved. The rows are ordered in the same order as they are in this list.

rowRole : string

The item model role to map into row category.

rowRolePattern : regExp

When set, a search and replace is done on the value mapped by row role before it is used as a row category. This property specifies the regular expression to find the portion of the mapped value to replace and rowRoleReplace property contains the replacement string. This is useful for example in parsing row and column categories from a single timestamp field in the item model.

另请参阅 rowRole and rowRoleReplace .

rowRoleReplace : string

This property defines the replacement content to be used in conjunction with rowRolePattern . Defaults to empty string. For more information on how the search and replace using regular expressions works, see QString::replace (const QRegularExpression &rx, const QString &after) function documentation.

另请参阅 rowRole and rowRolePattern .

type : AbstractDataProxy . DataType [read-only]

The type of the proxy. One of the QAbstractDataProxy::DataType 值。

useModelCategories : bool

当设为 true , the mapping ignores row and column roles and categories, and uses the rows and columns from the model instead. Row and column headers are used for row and column labels. Defaults to false .

valueRole : string

The item model role to map into bar value.

valueRolePattern : regExp

When set, a search and replace is done on the value mapped by value role before it is used as a bar value. This property specifies the regular expression to find the portion of the mapped value to replace and valueRoleReplace property contains the replacement string.

另请参阅 valueRole and valueRoleReplace .

valueRoleReplace : string

This property defines the replacement content to be used in conjunction with valueRolePattern . Defaults to empty string. For more information on how the search and replace using regular expressions works, see QString::replace (const QRegularExpression &rx, const QString &after) function documentation.

另请参阅 valueRole and valueRolePattern .

信号文档编制

autoColumnCategoriesChanged ( bool enable )

此信号发射,当 autoColumnCategories changes to enable .

注意: 相应处理程序是 onAutoColumnCategoriesChanged .

autoRowCategoriesChanged ( bool enable )

此信号发射,当 autoRowCategories changes to enable .

注意: 相应处理程序是 onAutoRowCategoriesChanged .

columnCategoriesChanged ()

此信号发射,当 columnCategories 改变。

注意: 相应处理程序是 onColumnCategoriesChanged .

columnRoleChanged ( string role )

此信号发射,当 columnRole changes to role .

注意: 相应处理程序是 onColumnRoleChanged .

columnRolePatternChanged ( regExp pattern )

此信号发射,当 columnRolePattern changes to pattern .

注意: 相应处理程序是 onColumnRolePatternChanged .

columnRoleReplaceChanged ( string replace )

此信号发射,当 columnRoleReplace changes to replace .

注意: 相应处理程序是 onColumnRoleReplaceChanged .

itemModelChanged ( model itemModel )

此信号发射,当 itemModel changes to itemModel .

注意: 相应处理程序是 onItemModelChanged .

multiMatchBehaviorChanged ( enumeration behavior )

此信号发射,当 multiMatchBehavior changes to behavior .

注意: 相应处理程序是 onMultiMatchBehaviorChanged .

rotationRoleChanged ( string role )

此信号发射,当 rotationRole changes to role .

注意: 相应处理程序是 onRotationRoleChanged .

rotationRolePatternChanged ( regExp pattern )

此信号发射,当 rotationRolePattern changes to pattern .

注意: 相应处理程序是 onRotationRolePatternChanged .

rotationRoleReplaceChanged ( string replace )

此信号发射,当 rotationRoleReplace changes to replace .

注意: 相应处理程序是 onRotationRoleReplaceChanged .

rowCategoriesChanged ()

此信号发射,当 rowCategories 改变。

注意: 相应处理程序是 onRowCategoriesChanged .

rowRoleChanged ( string role )

此信号发射,当 rowRole changes to role .

注意: 相应处理程序是 onRowRoleChanged .

rowRolePatternChanged ( regExp pattern )

此信号发射,当 rowRolePattern changes to pattern .

注意: 相应处理程序是 onRowRolePatternChanged .

rowRoleReplaceChanged ( string replace )

此信号发射,当 rowRoleReplace changes to replace .

注意: 相应处理程序是 onRowRoleReplaceChanged .

useModelCategoriesChanged ( bool enable )

此信号发射,当 useModelCategories changes to enable .

注意: 相应处理程序是 onUseModelCategoriesChanged .

valueRoleChanged ( string role )

此信号发射,当 valueRole changes to role .

注意: 相应处理程序是 onValueRoleChanged .

valueRolePatternChanged ( regExp pattern )

此信号发射,当 valueRolePattern changes to pattern .

注意: 相应处理程序是 onValueRolePatternChanged .

valueRoleReplaceChanged ( string replace )

此信号发射,当 valueRoleReplace changes to replace .

注意: 相应处理程序是 onValueRoleReplaceChanged .