本页内容

QHBoxPlotModelMapper Class

QHBoxPlotModelMapper 类是一个用于箱线图序列的水平模型映射器。更多内容...

Header: #include <QHBoxPlotModelMapper>
In QML: HBoxPlotModelMapper
Inherits: QObject
Status: Deprecated

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

属性

公共函数

QHBoxPlotModelMapper(QObject *parent = nullptr)
int columnCount() const
int firstBoxSetRow() const
int firstColumn() const
int lastBoxSetRow() const
QAbstractItemModel *model() const
QBoxPlotSeries *series() const
void setColumnCount(int rowCount)
void setFirstBoxSetRow(int firstBoxSetRow)
void setFirstColumn(int firstColumn)
void setLastBoxSetRow(int lastBoxSetRow)
void setModel(QAbstractItemModel *model)
void setSeries(QBoxPlotSeries *series)

信号

详细说明

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

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

模型映射器确保箱线图系列中的所有箱线图项目大小一致。因此,向某个箱线图项目添加或移除一个值,会导致箱线图系列中的所有箱线图项目发生相同的变更。

另请参阅 QVBoxPlotModelMapper 。

属性文档

columnCount : int

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

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

访问函数:

int columnCount() const
void setColumnCount(int rowCount)

通知信号:

firstBoxSetRow : int

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

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

访问函数:

int firstBoxSetRow() const
void setFirstBoxSetRow(int firstBoxSetRow)

通知信号:

firstColumn : int

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

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

访问函数:

int firstColumn() const
void setFirstColumn(int firstColumn)

通知信号:

lastBoxSetRow : int

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

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

访问函数:

int lastBoxSetRow() const
void setLastBoxSetRow(int lastBoxSetRow)

通知信号:

model : QAbstractItemModel*

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

访问函数:

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

通知器信号:

void modelReplaced()

series : QBoxPlotSeries*

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

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

访问函数:

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

通知信号:

成员函数文档

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

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

[signal] void QHBoxPlotModelMapper::columnCountChanged()

当列数发生变化时,会发出此信号。

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

[signal] void QHBoxPlotModelMapper::firstBoxSetRowChanged()

当第一行箱线图数据发生变化时,会触发此信号。

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

[signal] void QHBoxPlotModelMapper::firstColumnChanged()

当第一列发生变化时,会发出此信号。

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

[signal] void QHBoxPlotModelMapper::lastBoxSetRowChanged()

当最后一行箱线图数据发生变化时,会触发此信号。

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

[signal] void QHBoxPlotModelMapper::modelReplaced()

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

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

[signal] void QHBoxPlotModelMapper::seriesReplaced()

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

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

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