Qt 5.8 | Qt Charts | C++ Classes | QVPieModelMapper

Qt 5.8.0 Reference Documentation

# QVPieModelMapper Class

Vertical model mapper for pie series. More...

Header: | #include <QVPieModelMapper>
Instantiated By: | VPieModelMapper
Inherits: | QPieModelMapper

- List of all members, including inherited members

## Properties

- firstRow : int
- labelsColumn : int
- model : QAbstractItemModel *

- rowCount : int
- series : QPieSeries *
- valuesColumn : int

## Public Functions

| QVPieModelMapper(QObject *parent = Q_NULLPTR)
int | firstRow() const
int | labelsColumn() const
QAbstractItemModel * | model() const
int | rowCount() const
QPieSeries * | series() const
void | setFirstRow(int firstRow)
void | setLabelsColumn(int labelsColumn)
void | setModel(QAbstractItemModel *model)
void | setRowCount(int rowCount)
void | setSeries(QPieSeries *series)
void | setValuesColumn(int valuesColumn)
int | valuesColumn() const

## Signals

void | firstRowChanged()
void | labelsColumnChanged()
void | modelReplaced()
void | rowCountChanged()
void | seriesReplaced()
void | valuesColumnChanged()

### Additional Inherited Members

- 14 protected functions inherited from QPieModelMapper

## Detailed Description

Vertical model mapper for pie series.

Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series. Vertical model mapper is used to create a connection between QPieSeries and QAbstractItemModel derived model object that keeps the consecutive pie slices data in columns. It is possible to use both QAbstractItemModel and QPieSeries model API. QVPieModelMapper makes sure that Pie and the model are kept in sync.

Note: Used model has to support adding/removing rows/columns and modifying the data of the cells.

## Property Documentation

### firstRow : int

This property defines which row of the model contains the first slice value.

Minimal and default value is: 0

Access functions:

int | firstRow() const
void | setFirstRow(int firstRow)

Notifier signal:

void | firstRowChanged()

### labelsColumn : int

This property defines which column of the model is kept in sync with the labels of the pie's slices.

Default value is: -1 (invalid mapping)

Access functions:

int | labelsColumn() const
void | setLabelsColumn(int labelsColumn)

Notifier signal:

void | labelsColumnChanged()

### model : QAbstractItemModel *

This property defines the model that is used by the mapper.

Access functions:

QAbstractItemModel * | model() const
void | setModel(QAbstractItemModel *model)

Notifier signal:

void | modelReplaced()

### rowCount : int

This property defines the number of rows of the model that are mapped as the data for QPieSeries.

Minimal and default value is: -1 (count limited by the number of rows in the model)

Access functions:

int | rowCount() const
void | setRowCount(int rowCount)

Notifier signal:

void | rowCountChanged()

### series : QPieSeries *

This property defines the QPieSeries 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).

Access functions:

QPieSeries * | series() const
void | setSeries(QPieSeries *series)

Notifier signal:

void | seriesReplaced()

### valuesColumn : int

This property defines which column of the model is kept in sync with the values of the pie's slices.

Default value is: -1 (invalid mapping)

Access functions:

int | valuesColumn() const
void | setValuesColumn(int valuesColumn)

Notifier signal:

void | valuesColumnChanged()

## Member Function Documentation

### QVPieModelMapper::QVPieModelMapper(QObject *parent = Q_NULLPTR)

Constructs a mapper object which is a child of parent.

### `[signal]` void QVPieModelMapper::firstRowChanged()

Emitted when the firstRow has changed.

Note: Notifier signal for property firstRow.

### int QVPieModelMapper::labelsColumn() const

Returns which column of the model is kept in sync with the labels of the pie's slices

Note: Getter function for property labelsColumn.

See also setLabelsColumn().

### `[signal]` void QVPieModelMapper::labelsColumnChanged()

Emitted when the labelsColumn has changed.

Note: Notifier signal for property labelsColumn.

### `[signal]` void QVPieModelMapper::modelReplaced()

Emitted when the model to which mapper is connected to has changed.

Note: Notifier signal for property model.

### `[signal]` void QVPieModelMapper::rowCountChanged()

Emitted when the rowCount has changed.

Note: Notifier signal for property rowCount.

### `[signal]` void QVPieModelMapper::seriesReplaced()

Emitted when the series to which mapper is connected to has changed.

Note: Notifier signal for property series.

### void QVPieModelMapper::setLabelsColumn(int labelsColumn)

Sets the model column that is kept in sync with the pie's slices labels. Parameter labelsColumn specifies the row of the model.

Note: Setter function for property labelsColumn.

See also labelsColumn().

### void QVPieModelMapper::setValuesColumn(int valuesColumn)

Sets the model column that is kept in sync with the pie slices values. Parameter valuesColumn specifies the row of the model.

Note: Setter function for property valuesColumn.

See also valuesColumn().

### int QVPieModelMapper::valuesColumn() const

Returns which column of the model is kept in sync with the values of the pie's slices

Note: Getter function for property valuesColumn.

See also setValuesColumn().

### `[signal]` void QVPieModelMapper::valuesColumnChanged()

Emitted when the valuesColumn has changed.

Note: Notifier signal for property valuesColumn.