QHBarModelMapper Class | Qt Charts 5.7

Qt 5.7 | Qt Charts | C++ Classes | QHBarModelMapper

Qt 5.7.1 Reference Documentation

# QHBarModelMapper Class

Horizontal model mapper for bar series. More...

Header: | #include <QHBarModelMapper>
Instantiated By: | HBarModelMapper
Inherits: | QBarModelMapper

- List of all members, including inherited members

## Properties

- columnCount : int
- firstBarSetRow : int
- firstColumn : int

- lastBarSetRow : int
- model : QAbstractItemModel *
- series : QAbstractBarSeries *

- 1 property inherited from QObject

## Public Functions

| QHBarModelMapper(QObject *parent = Q_NULLPTR)
int | columnCount() const
int | firstBarSetRow() const
int | firstColumn() const
int | lastBarSetRow() const
QAbstractItemModel * | model() const
QAbstractBarSeries * | series() const
void | setColumnCount(int columnCount)
void | setFirstBarSetRow(int firstBarSetRow)
void | setFirstColumn(int firstColumn)
void | setLastBarSetRow(int lastBarSetRow)
void | setModel(QAbstractItemModel *model)
void | setSeries(QAbstractBarSeries *series)

- 31 public functions inherited from QObject

## Signals

void | columnCountChanged()
void | firstBarSetRowChanged()
void | firstColumnChanged()
void | lastBarSetRowChanged()
void | modelReplaced()
void | seriesReplaced()

- 2 signals inherited from QObject

### Additional Inherited Members

- 1 public slot inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 14 protected functions inherited from QBarModelMapper
- 9 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

Horizontal model mapper for bar 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 QAbstractBarSeries and QAbstractItemModel derived model object. Model mapper maintains equal size of all the BarSets. Adding/removing value from the BarSet causes the the same change in the rest of the BarSets added to the same series.

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 QAbstractBarSeries.

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

### firstBarSetRow : int

This property defines which column of the model is used as the data source for the first bar set.

Default value is: -1 (invalid mapping)

Access functions:

int | firstBarSetRow() const
void | setFirstBarSetRow(int firstBarSetRow)

Notifier signal:

void | firstBarSetRowChanged()

### firstColumn : int

This property defines which column of the model contains the first values of the QBarSets in the series.

Minimal and default value is: 0

Access functions:

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

Notifier signal:

void | firstColumnChanged()

### lastBarSetRow : int

This property defines which column of the model is used as the data source for the last bar set.

Default value is: -1 (invalid mapping)

Access functions:

int | lastBarSetRow() const
void | setLastBarSetRow(int lastBarSetRow)

Notifier signal:

void | lastBarSetRowChanged()

### 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 : QAbstractBarSeries *

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:

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

Notifier signal:

void | seriesReplaced()

## Member Function Documentation

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

Constructs a mapper object which is a child of parent.

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

Emitted when the columnCount has changed.

Note: Notifier signal for property columnCount.

### `[signal]` void QHBarModelMapper::firstBarSetRowChanged()

Emitted when the firstBarSetRow has changed.

Note: Notifier signal for property firstBarSetRow.

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

Emitted when the firstColumn has changed.

Note: Notifier signal for property firstColumn.

### `[signal]` void QHBarModelMapper::lastBarSetRowChanged()

Emitted when the lastBarSetRow has changed.

Note: Notifier signal for property lastBarSetRow.

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

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

Note: Notifier signal for property model.

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

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

Note: Notifier signal for property series.