Model mapper for pie series. 更多...
| import 语句: |
import QtGraphs
|
| 在 C++: | QPieModelMapper |
模型映射器允许使用的数据模型派生自 QAbstractItemModel class as a data source for a graph. A model mapper is used to create a connection between a data model and PieSeries .
Both model and pie series properties can be used to manipulate the data. The model mapper keeps the pie series and the data model in sync.
The following QML example creates a pie series with four slices (assuming the model has at least five rows). Each slice gets a label from column 1 and a value from column 2.
PieModelMapper { series: pieSeries model: customModel labelsSection: 1 valuesSection: 2 firstRow: 1 rowCount: 4 orientation: Qt.Vertical }
|
count : qsizetype |
The number of columns or rows of the model that are mapped as the data for a pie series. The default value is -1 (number limited by the number of rows in the model).
另请参阅 orientation .
|
first : qsizetype |
The column or row of the model that contains the first slice value. The default value is 0.
另请参阅 orientation .
|
labelsSection : qsizetype |
The column or row of the model that is kept in sync with the labels of the pie's slices. The default value is -1 (invalid mapping).
另请参阅 orientation .
|
model : model |
The QAbstractItemModel based model that is used by the mapper. You need to implement the model and expose it to QML.
注意: The model has to support adding and removing rows or columns and modifying the data in the cells.
|
orientation : orientation |
Tells the modelmapper how to map data from a model. If
Qt.Vertical
is used, each of the model's rows defines a pie slice, and the model's columns define the label or the value of the pie slice. When the orientation is set to
Qt.Horizontal
, each of the model's columns defines a pie slice, and the model's rows define the label or the value of the pie slice.
默认值为
Qt.Vertical
|
series : PieSeries |
The pie series that is used by the mapper. If you define the mapper element as a child for a PieSeries , leave this property undefined. 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 (but it preserves its data).
|
valuesSection : qsizetype |
The column or row of the model that is kept in sync with the values of the pie's slices. The default value is -1 (invalid mapping).
另请参阅 orientation .
|
countChanged () |
This signal is emitted when the count changes.
注意:
相应处理程序是
onCountChanged
.
|
firstChanged () |
This signal is emitted when the first slice changes.
注意:
相应处理程序是
onFirstChanged
.
|
labelsSectionChanged () |
This signal is emitted when the labels section changes.
注意:
相应处理程序是
onLabelsSectionChanged
.
|
modelChanged () |
This signal is emitted when the model that the mapper is connected to changes.
注意:
相应处理程序是
onModelChanged
.
|
orientationChanged () |
This signal is emitted when the orientation changes.
注意:
相应处理程序是
onOrientationChanged
.
|
seriesChanged () |
This signal is emitted when the series that the mapper is connected to changes.
注意:
相应处理程序是
onSeriesChanged
.
|
valuesSectionChanged () |
This signal is emitted when the values section changes.
注意:
相应处理程序是
onValuesSectionChanged
.