本页内容

QVBoxPlotModelMapper Class

QVBoxPlotModelMapper 是一个用于箱线图数据系列的垂直模型映射器。更多内容...

Header: #include <QVBoxPlotModelMapper>
In QML: VBoxPlotModelMapper
Inherits: QObject
Status: Deprecated

该类已弃用。我们强烈建议不要在新代码中使用它。

属性

公共函数

QVBoxPlotModelMapper(QObject *parent = nullptr)
int firstBoxSetColumn() const
int firstRow() const
int lastBoxSetColumn() const
QAbstractItemModel *model() const
int rowCount() const
QBoxPlotSeries *series() const
void setFirstBoxSetColumn(int firstBoxSetColumn)
void setFirstRow(int firstRow)
void setLastBoxSetColumn(int lastBoxSetColumn)
void setModel(QAbstractItemModel *model)
void setRowCount(int rowCount)
void setSeries(QBoxPlotSeries *series)

信号

详细说明

模型映射器允许将源自QAbstractItemModel 类的数据模型用作图表的数据源。 垂直模型映射器用于在数据模型与QBoxPlotSeries 对象之间建立连接,使得数据模型中的每一列都定义一个箱线图项目,每一行则映射到该箱线图项目的范围及其三个中位数值。

既可以使用模型属性,也可以使用系列属性来操作数据。模型映射器会保持系列与数据模型之间的同步。

模型映射器可确保箱线图系列中的所有条形箱线图项大小一致。因此,对某个箱线图项添加或删除一个值,将导致箱线图系列中的所有箱线图项产生相同的变更。

另请参阅 QHBoxPlotModelMapper 。

属性文档

firstBoxSetColumn : int

此属性存储模型中用作第一个箱线图项目数据源的列。

默认值为 -1(映射无效)。

访问函数:

int firstBoxSetColumn() const
void setFirstBoxSetColumn(int firstBoxSetColumn)

通知信号:

firstRow : int

该属性存储模型中包含箱线图系列中各项目首个值的行。

其最小值和默认值均为 0。

访问函数:

int firstRow() const
void setFirstRow(int firstRow)

通知信号:

lastBoxSetColumn : int

该属性存储了用作最后一个箱线图项目数据源的模型列。

默认值为 -1(映射无效)。

访问函数:

int lastBoxSetColumn() const
void setLastBoxSetColumn(int lastBoxSetColumn)

通知信号:

model : QAbstractItemModel*

该属性存储映射器所使用的模型。

访问函数:

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

通知器信号:

void modelReplaced()

rowCount : int

该属性存储了模型中作为箱线图系列数据映射的行数。

其最小值和默认值为 -1(数值上限为模型中的列数)。

访问函数:

int rowCount() const
void setRowCount(int rowCount)

通知信号:

series : QBoxPlotSeries*

该属性保存映射器所使用的箱线图系列。

当将其设置为映射器时,该系列中的所有数据都会被丢弃。指定新系列时,旧系列将被断开连接(但其数据仍会被保留)。

访问函数:

QBoxPlotSeries *series() const
void setSeries(QBoxPlotSeries *series)

通知信号:

成员函数文档

[explicit] QVBoxPlotModelMapper::QVBoxPlotModelMapper(QObject *parent = nullptr)

构建一个作为parent 子节点的映射器对象。

[signal] void QVBoxPlotModelMapper::firstBoxSetColumnChanged()

当第一个箱线图项目列发生变化时,会触发此信号。

注意: 这是属性firstBoxSetColumn的通知器 信号。

[signal] void QVBoxPlotModelMapper::firstRowChanged()

当第一行发生变化时,会触发此信号。

注意: 这是属性firstRow的通知器 信号。

[signal] void QVBoxPlotModelMapper::lastBoxSetColumnChanged()

当最后一个箱线图项目列发生变化时,会发出此信号。

注意: 这是属性lastBoxSetColumn的通知器 信号。

[signal] void QVBoxPlotModelMapper::modelReplaced()

当映射器所连接的模型发生变化时,会触发此信号。

注意: 这是属性model的通知器 信号。

[signal] void QVBoxPlotModelMapper::rowCountChanged()

当行数发生变化时,会触发此信号。

注意: 这是属性rowCount的通知 信号。

[signal] void QVBoxPlotModelMapper::seriesReplaced()

当映射器所连接的系列发生变化时,会发出此信号。

注意: 这是属性series 的Notifier 信号。

© 2026 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.