VBarModelMapper QML Type
Vertical model mapper for bar series. More...
Import Statement: | import QtCharts 2.1 |
Instantiates: | QVBarModelMapper |
Properties
- firstBarSetColumn : int
- firstBoxSetColumn : int
- firstRow : int
- lastBarSetColumn : int
- lastBoxSetColumn : int
- model : SomeModel
- rowCount : int
- series : AbstractBarSeries
Detailed Description
VBarModelMapper allows you to use your own QAbstractItemModel derived model with data in columns as a data source for any bar series. It is possible to use both QAbstractItemModel and bar series data API to manipulate data. VBarModelMapper keeps the series and the model in sync.
The following QML example would create a bar series with three bar sets (assuming the model has at least four columns). Each bar set would contain data starting from row 1. The name of a set would be defined by the horizontal header (of the column).
BarSeries { VBarModelMapper { model: myCustomModel // QAbstractItemModel derived implementation firstBarSetColumn: 1 lastBarSetColumn: 3 firstRow: 1 } }
Property Documentation
Defines which column of the model is used as the data source for the first bar set. Default value is: -1 (invalid mapping).
Defines which column of the model is used as the data source for the first box-and-whiskers set. Default value is: -1 (invalid mapping).
Defines which row of the model contains the first values of the QBarSets in the series. The default value is 0.
Defines which column of the model is used as the data source for the last bar set. Default value is: -1 (invalid mapping).
Defines which column of the model is used as the data source for the last box-and-whiskers set. Default value is: -1 (invalid mapping).
The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to QML. Note: the model has to support adding/removing rows/columns and modifying the data of the cells.
Defines the number of rows of the model that are mapped as the data for QAbstractBarSeries. The default value is -1 (count limited by the number of rows in the model)
series : AbstractBarSeries |
Defines the AbstractBarSeries based object that is used by the mapper. All the data in the series is discarded when it is set to the mapper. When new series is specified the old series is disconnected (it preserves its data).