QHPieModelMapper Class | Qt Charts 5.7

Qt 5.7 | Qt Charts | C++ Classes | QHPieModelMapper

Qt 5.7.1 Reference Documentation

# QHPieModelMapper Class

Horizontal model mapper for pie series. More...

Header: | #include <QHPieModelMapper>
Instantiated By: | HPieModelMapper
Inherits: | QPieModelMapper

- List of all members, including inherited members

## Properties

columnCount : int firstColumn : int labelsRow : int | model : QAbstractItemModel * series : QPieSeries * valuesRow : int

## Public Functions

| QHPieModelMapper(QObject *parent = Q_NULLPTR)
int | columnCount() const
int | firstColumn() const
int | labelsRow() const
QAbstractItemModel * | model() const
QPieSeries * | series() const
void | setColumnCount(int columnCount)
void | setFirstColumn(int firstColumn)
void | setLabelsRow(int labelsRow)
void | setModel(QAbstractItemModel *model)
void | setSeries(QPieSeries *series)
void | setValuesRow(int valuesRow)
int | valuesRow() const

## Signals

void | columnCountChanged()
void | firstColumnChanged()
void | labelsRowChanged()
void | modelReplaced()
void | seriesReplaced()
void | valuesRowChanged()

### Additional Inherited Members

- 14 protected functions inherited from QPieModelMapper

## Detailed Description

Horizontal model mapper for pie series.

Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series. Horizontal model mapper is used to create a connection between QPieSeries and QAbstractItemModel derived model object that keeps the consecutive pie slices data in rows. It is possible to use both QAbstractItemModel and QPieSeries model API. QHPieModelMapper 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

### columnCount : int

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

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

Access functions:

int | columnCount() const
void | setColumnCount(int columnCount)

Notifier signal:

void | columnCountChanged()

### firstColumn : int

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

Minimal and default value is: 0

Access functions:

int | firstColumn() const
void | setFirstColumn(int firstColumn)

Notifier signal:

void | firstColumnChanged()

### labelsRow : int

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

Default value is: -1 (invalid mapping)

Access functions:

int | labelsRow() const
void | setLabelsRow(int labelsRow)

Notifier signal:

void | labelsRowChanged()

### 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()

### 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()

### valuesRow : int

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

Default value is: -1 (invalid mapping)

Access functions:

int | valuesRow() const
void | setValuesRow(int valuesRow)

Notifier signal:

void | valuesRowChanged()

## Member Function Documentation

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

Constructs a mapper object which is a child of parent.

### `[signal]` void QHPieModelMapper::columnCountChanged()

Emitted when the columnCount has changed.

Note: Notifier signal for property columnCount.

### `[signal]` void QHPieModelMapper::firstColumnChanged()

Emitted when the firstColumn has changed.

Note: Notifier signal for property firstColumn.

### int QHPieModelMapper::labelsRow() const

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

Note: Getter function for property labelsRow.

See also setLabelsRow().

### `[signal]` void QHPieModelMapper::labelsRowChanged()

Emitted when the labelsRow has changed.

Note: Notifier signal for property labelsRow.

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

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

Note: Notifier signal for property model.

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

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

Note: Notifier signal for property series.

### void QHPieModelMapper::setLabelsRow(int labelsRow)

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

Note: Setter function for property labelsRow.

See also labelsRow().

### void QHPieModelMapper::setValuesRow(int valuesRow)

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

Note: Setter function for property valuesRow.

See also valuesRow().

### int QHPieModelMapper::valuesRow() const

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

Note: Getter function for property valuesRow.

See also setValuesRow().

### `[signal]` void QHPieModelMapper::valuesRowChanged()

Emitted when the valuesRow has changed.

Note: Notifier signal for property valuesRow.