QHPieModelMapper Class

QHPieModelMapper 是饼系列的水平模型映射器。更多

Header: #include <QHPieModelMapper>
In QML: HPieModelMapper
Inherits: QPieModelMapper

属性

公共功能

QHPieModelMapper(QObject *parent = nullptr)
int columnCount() const
int firstColumn() const
int labelsRow() const
QAbstractItemModel *model() const
QPieSeries *series() const
void setColumnCount(int columnCount)
void setFirstColumn(int firstColumn)
void setLabelsRow(int labelsRow)
void setModel(QAbstractItemModel *model)
void setSeries(QPieSeries *series)
void setValuesRow(int valuesRow)
int valuesRow() const

信号

详细说明

模型映射器可将源自QAbstractItemModel 类的数据模型用作图表的数据源。水平模型映射器用于在数据模型和QPieSeries 之间创建连接,以便数据模型中的每一列都定义一个饼片,每一行都映射到饼片的标签或值。

模型和饼系列属性都可用于操作数据。模型映射器可使饼系列和数据模型保持同步。

属性文档

columnCount : int

此属性用于保存被映射为饼状序列数据的模型列数。

最小值和默认值均为-1(数量限制为模型中的列数)。

访问功能:

int columnCount() const
void setColumnCount(int columnCount)

通知信号:

firstColumn : int

此属性保存模型中包含第一个切分值的列。

最小默认值为 0。

访问功能:

int firstColumn() const
void setFirstColumn(int firstColumn)

通知信号:

labelsRow : int

此属性用于保存与饼的切片标签同步的模型行。

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

访问功能

int labelsRow() const
void setLabelsRow(int labelsRow)

通知信号:

model : QAbstractItemModel*

该属性包含映射器使用的模型。

访问功能:

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

Notifier 信号:

void modelReplaced()

series : QPieSeries*

该属性包含映射器使用的饼系列。

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

访问功能:

QPieSeries *series() const
void setSeries(QPieSeries *series)

通知信号:

valuesRow : int

此属性用于保存与饼的切片值保持同步的模型行。

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

访问功能

int valuesRow() const
void setValuesRow(int valuesRow)

Notifier 信号:

成员函数 文档

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

构造一个parent 的子映射器对象。

[signal] void QHPieModelMapper::columnCountChanged()

列数发生变化时会发出该信号。

注: 属性columnCount 的通知信号。

[signal] void QHPieModelMapper::firstColumnChanged()

该信号在第一列发生变化时发出。

注: 属性firstColumn 的通知信号。

int QHPieModelMapper::labelsRow() const

返回与派的切片标签保持同步的模型行。

注: 属性 labelsRow 的获取函数。

另请参阅 setLabelsRow().

[signal] void QHPieModelMapper::labelsRowChanged()

当标签行发生变化时发出该信号。

注: 属性labelsRow 的通知信号。

[signal] void QHPieModelMapper::modelReplaced()

当映射器所连接的模型发生变化时会发出该信号。

注: 用于属性model 的 Notifier 信号。

[signal] void QHPieModelMapper::seriesReplaced()

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

注: 用于属性series 的通知信号。

void QHPieModelMapper::setLabelsRow(int labelsRow)

将与饼状切片标签保持同步的模型行设置为labelsRow

注: 属性labelsRow 的设置函数。

另请参阅 labelsRow() 。

void QHPieModelMapper::setValuesRow(int valuesRow)

将与饼状切片值保持同步的模型行设置为valuesRow

注: 属性valuesRow 的设置函数。

另请参阅 valuesRow() 。

int QHPieModelMapper::valuesRow() const

返回与饼的切片值保持同步的模型行。

注: 属性 valuesRow 的获取函数。

另请参阅 setValuesRow().

[signal] void QHPieModelMapper::valuesRowChanged()

当数值行发生变化时会发出该信号。

注: 属性valuesRow 的通知信号。

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