Qt 5.7 | Qt Data Visualization | QML Types | ItemModelSurfaceDataProxy QML Type

Qt 5.7.1 Reference Documentation

# ItemModelSurfaceDataProxy QML Type

Proxy class for presenting data in item models with Surface3D. More...

Import Statement: | import QtDataVisualization 1.2
Since: | QtDataVisualization 1.0
Instantiates: | QItemModelSurfaceDataProxy
Inherits: | SurfaceDataProxy

- List of all members, including inherited members

## Properties

- autoColumnCategories : bool
- autoRowCategories : bool
- columnCategories : list<String>
- columnRole : string
- columnRolePattern : regExp
- columnRoleReplace : string
- itemModel : model
- multiMatchBehavior : ItemModelSurfaceDataProxy.MultiMatchBehavior
- rowCategories : list<String>
- rowRole : string
- rowRolePattern : regExp
- rowRoleReplace : string
- useModelCategories : bool
- xPosRole : string
- xPosRolePattern : regExp
- xPosRoleReplace : string
- yPosRole : string
- yPosRolePattern : regExp
- yPosRoleReplace : string
- zPosRole : string
- zPosRolePattern : regExp
- zPosRoleReplace : string

## Detailed Description

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

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

For ItemModelSurfaceDataProxy enums, see QItemModelSurfaceDataProxy::MultiMatchBehavior.

For more details, see QItemModelSurfaceDataProxy documentation.

Usage example:

      ItemModelSurfaceDataProxy {
          itemModel: model // E.g. a list model defined elsewhere containing population data.
          // Mapping model roles to surface series rows, columns, and values.
          rowRole: "longitude"
          columnRole: "latitude"
          valueRole: "pop_density"
      }

See also SurfaceDataProxy and Qt Data Visualization Data Handling.

## 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. Proxy minimum and maximum column values are also autogenerated from data when this is set to true. 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 model is resolved. Proxy minimum and maximum row values are also autogenerated from data when this is set to true. Defaults to `true`.

columnCategories : list<String>

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

columnRole : string

Defines the item model role to map into column category. In addition to defining which column the data belongs to, the value indicated by column role is also set as the X-coordinate value of the QSurfaceDataItem when model data is resolved, unless a separate xPos role is also defined.

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.

See also 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.

See also columnRole and columnRolePattern.

itemModel : model

The item model.

multiMatchBehavior : ItemModelSurfaceDataProxy.MultiMatchBehavior

This property defines how multiple matches for each row/column combination are handled. Defaults to ItemModelSurfaceDataProxy.MMBLast.

For example, you might have an item model with timestamped data taken at irregular intervals and you want to visualize an average position of data items on each hour with a surface graph. This can be done by specifying row and column categories so that each surface point represents an hour, and setting multiMatchBehavior to ItemModelSurfaceDataProxy.MMBAverage.

rowCategories : list<String>

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

rowRole : string

Defines the item model role to map into row category. In addition to defining which row the data belongs to, the value indicated by row role is also set as the Z-coordinate value of the QSurfaceDataItem when model data is resolved, unless a separate zPos role is also defined.

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.

See also 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.

See also rowRole and 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. Defaults to `false`.

xPosRole : string

Defines the item model role to map into X position. If this role is not defined, columnRole is used to determine the X-coordinate value of resolved QSurfaceDataItems.

xPosRolePattern : regExp

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

See also xPosRole and xPosRoleReplace.

xPosRoleReplace : string

This property defines the replace content to be used in conjunction with xPosRolePattern. 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.

See also xPosRole and xPosRolePattern.

yPosRole : string

Defines the item model role to map into Y position.

yPosRolePattern : regExp

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

See also yPosRole and yPosRoleReplace.

yPosRoleReplace : string

This property defines the replace content to be used in conjunction with yPosRolePattern. 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.

See also yPosRole and yPosRolePattern.

zPosRole : string

Defines the item model role to map into Z position. If this role is not defined, rowRole is used to determine the Z-coordinate value of resolved QSurfaceDataItems.

zPosRolePattern : regExp

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

See also zPosRole and zPosRoleReplace.

zPosRoleReplace : string

This property defines the replace content to be used in conjunction with zPosRolePattern. 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.

See also zPosRole and zPosRolePattern.