ItemModelBarDataProxy QML Type

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

import 语句: import QtDataVisualization 1.15
Since: QtDataVisualization 1.0
实例化: 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: ["2010", "2011", "2012", "2013"]
    columnCategories: ["Oulu", "Rauma", "Helsinki", "Tampere"]
}
					

另请参阅 BarDataProxy and Qt Data Visualization 数据处理 .

特性文档编制

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 < String >

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 replace 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 QRegExp &rx, const QString &after) function documentation.

另请参阅 columnRole and columnRolePattern .

itemModel : model

The item model.

multiMatchBehavior : ItemModelBarDataProxy . MultiMatchBehavior

Defines how multiple matches for each row/column combination are handled. Defaults to ItemModelBarDataProxy.MMBLast . 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.MMBCumulative .

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 replace 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 QRegExp &rx, const QString &after) function documentation.

另请参阅 rotationRole and rotationRolePattern .

rowCategories : list < String >

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 replace 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 QRegExp &rx, const QString &after) function documentation.

另请参阅 rowRole and rowRolePattern .

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 replace 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 QRegExp &rx, const QString &after) function documentation.

另请参阅 valueRole and valueRolePattern .