Qt 5.11 | Qt Charts | C++ Classes | QVXYModelMapper

Qt Charts | Commercial or GPLv3

# QVXYModelMapper Class

The QVXYModelMapper class is a vertical model mapper for line, spline, and scatter series. More...

Header: | #include <QVXYModelMapper>
Instantiated By: | VXYModelMapper
Inherits: | QXYModelMapper

- List of all members, including inherited members

## Properties

- firstRow : int
- model : QAbstractItemModel*
- rowCount : int

- series : QtCharts::QXYSeries*
- xColumn : int
- yColumn : int

## Public Functions

| QVXYModelMapper(QObject *parent = nullptr)
int | firstRow() const
QAbstractItemModel * | model() const
int | rowCount() const
QXYSeries * | series() const
void | setFirstRow(int firstRow)
void | setModel(QAbstractItemModel *model)
void | setRowCount(int rowCount)
void | setSeries(QXYSeries *series)
void | setXColumn(int xColumn)
void | setYColumn(int yColumn)
int | xColumn() const
int | yColumn() const

## Signals

void | firstRowChanged()
void | modelReplaced()
void | rowCountChanged()
void | seriesReplaced()
void | xColumnChanged()
void | yColumnChanged()

## Detailed Description

The QVXYModelMapper class is a vertical model mapper for line, spline, and scatter series.

Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A vertical model mapper is used to create a connection between a line, spline, or scatter series and the data model that holds the consecutive data point coordinates in columns.

Both model and series properties can be used to manipulate the data. The model mapper keeps the series and the data model in sync.

See also QHXYModelMapper and QXYSeries.

## Property Documentation

### firstRow : int

This property holds the row of the model that contains the data for the first point of the series.

The minimum and default value is 0.

Access functions:

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

Notifier signal:

void | firstRowChanged()

### model : QAbstractItemModel*

This property holds 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 holds the number of rows of the model that are mapped as the data for series.

The minimum and default value is -1 (the number is limited by the number of rows in the model).

Access functions:

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

Notifier signal:

void | rowCountChanged()

### series : QtCharts::QXYSeries*

This property holds the series that is used by the mapper.

All the data in the series is discarded when it is set to the mapper. When a new series is specified, the old series is disconnected (but it preserves its data).

Access functions:

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

Notifier signal:

void | seriesReplaced()

### xColumn : int

This property holds the column of the model that contains the x-coordinates of data points.

The default value is -1 (invalid mapping).

Access functions:

int | xColumn() const
void | setXColumn(int xColumn)

Notifier signal:

void | xColumnChanged()

### yColumn : int

This property holds the column of the model that contains the y-coordinates of data points.

The default value is -1 (invalid mapping).

Access functions:

int | yColumn() const
void | setYColumn(int yColumn)

Notifier signal:

void | yColumnChanged()

## Member Function Documentation

### QVXYModelMapper::QVXYModelMapper(QObject *parent = nullptr)

Constructs a mapper object that is a child of parent.