QHBarModelMapper Class

The QHBarModelMapper class is a horizontal model mapper for bar series. More...

Header: #include <QHBarModelMapper>
Instantiated By: HBarModelMapper
Inherits: QObject

Properties

  • 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)
  • 32 public functions inherited from QObject

Signals

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QHBarModelMapper class is a horizontal model mapper for bar series.

Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A horizontal model mapper is used to create a connection between a data model and QAbstractBarSeries, so that each row in the data model defines a bar set and each column maps to a category in a bar series.

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

The model mapper ensures that all the bar sets in the bar series have equal sizes. Therefore, adding or removing a value from a bar set causes the same change to be made in all the bar sets in the bar series.

See also QVBarModelMapper.

Property Documentation

columnCount : int

This property holds the number of columns of the model that are mapped as the data for the bar series.

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

Access functions:

int columnCount() const
void setColumnCount(int columnCount)

Notifier signal:

firstBarSetRow : int

This property holds the row of the model that is used as the data source for the first bar set.

The default value is -1 (invalid mapping).

Access functions:

int firstBarSetRow() const
void setFirstBarSetRow(int firstBarSetRow)

Notifier signal:

firstColumn : int

This property holds the column of the model that contains the first values of the bar sets in the bar series.

The minimum and default value is 0.

Access functions:

int firstColumn() const
void setFirstColumn(int firstColumn)

Notifier signal:

lastBarSetRow : int

This property holds the row of the model that is used as the data source for the last bar set.

The default value is -1 (invalid mapping).

Access functions:

int lastBarSetRow() const
void setLastBarSetRow(int lastBarSetRow)

Notifier signal:

model : QAbstractItemModel *

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 holds the bar 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:

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

Notifier signal:

Member Function Documentation

QHBarModelMapper::QHBarModelMapper(QObject *parent = Q_NULLPTR)

Constructs a mapper object that is a child of parent.

[signal] void QHBarModelMapper::columnCountChanged()

This signal is emitted when the number of columns changes.

Note: Notifier signal for property columnCount.

[signal] void QHBarModelMapper::firstBarSetRowChanged()

This signal is emitted when the first bar set row changes.

Note: Notifier signal for property firstBarSetRow.

[signal] void QHBarModelMapper::firstColumnChanged()

This signal is emitted when the first column changes.

Note: Notifier signal for property firstColumn.

[signal] void QHBarModelMapper::lastBarSetRowChanged()

This signal is emitted when the last bar set row changes.

Note: Notifier signal for property lastBarSetRow.

[signal] void QHBarModelMapper::modelReplaced()

This signal is emitted when the model that the mapper is connected to changes.

Note: Notifier signal for property model.

[signal] void QHBarModelMapper::seriesReplaced()

This signal is emitted when the series that the mapper is connected to changes.

Note: Notifier signal for property series.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.