ItemModelBarDataProxy QML Type▲
-
Import Statement: import QtDataVisualization 1.4
-
Since:: QtDataVisualization 1.0
-
Inherits:: BarDataProxy
-
Instantiates:: QItemModelBarDataProxy
-
Group: ItemModelBarDataProxy is part of datavisualization_qml
Detailed Description▲
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.
For more details, see QItemModelBarDataProxy documentation.
Usage example:
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"
]
}
See Also▲
Property Documentation▲
autoColumnCategories : bool▲
When set to 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▲
When set to 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.
See Also▲
See also columnRole, 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 QRegularExpression &rx, const QString &after) function documentation.
See Also▲
See also columnRole, 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.
See Also▲
See also rotationRole, 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 QRegularExpression &rx, const QString &after) function documentation.
See Also▲
See also rotationRole, 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.
See Also▲
See also rowRole, 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 QRegularExpression &rx, const QString &after) function documentation.
See Also▲
See also rowRole, rowRolePattern
useModelCategories : bool▲
When set to 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.
See Also▲
See also valueRole, 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 QRegularExpression &rx, const QString &after) function documentation.
See Also▲
See also valueRole, valueRolePattern