XYModelMapper QML Type
Import Statement: | import QtGraphs |
In C++: | QXYModelMapper |
- 所有成员(包括继承成员)列表
- XYModelMapper 是Qt Graphs QML Types for 2D 的一部分。
属性
- count : qsizetype
- first : qsizetype
- model : SomeModel
- orientation : orientation
- series : XYSeries
- xSection : qsizetype
- ySection : qsizetype
信号
详细说明
模型映射器可将源自QAbstractItemModel 类的数据模型用作图表的数据源。模型映射器用于在直线、样条线或散点序列之间创建连接。表模型(TableModel)是模型的自然选择。
模型和序列属性都可用于操作数据。模型映射器可使序列和数据模型保持同步。
另请参见 XYSeries 。
属性文档
count : qsizetype |
映射为系列数据的模型行数。默认值为-1(该数值受模型行数限制)。
另请参阅 orientation 。
first : qsizetype |
包含序列第一点数据的模型行。默认值为 0。
另请参阅 orientation 。
model : SomeModel |
映射器使用的数据模型。您需要实现该模型并将其暴露给 QML。
注意: 模型必须支持添加和删除行或列,以及修改单元格中的数据。
orientation : orientation |
告诉模型映射器如何从模型映射数据。如果使用Qt.Vertical
,模型有X列和Y列,模型的行定义数据点。当方向设置为Qt.Horizontal
时,模型有X和Y行,模型的列定义数据点。
series : XYSeries |
映射器使用的序列。当向映射器设置序列时,序列中的所有数据都会被丢弃。当指定一个新系列时,旧系列将被断开(但保留其数据)。
xSection : qsizetype |
模型中包含数据点 x 坐标的部分。默认值为-1(映射无效)。
另请参阅 orientation 。
ySection : qsizetype |
模型中包含数据点 y 坐标的部分。默认值为-1(无效映射)。
另请参见 orientation 。
信号文档
countChanged() |
行数发生变化时会发出此信号。
注: 相应的处理程序是onCountChanged
。
firstChanged() |
当第一行发生变化时,发出该信号。
注: 相应的处理程序是onFirstChanged
。
modelChanged() |
当映射器所连接的模型发生变化时,会发出该信号。
注: 相应的处理程序是onModelChanged
。
xSectionChanged() |
当包含数据点 x 坐标的部分发生变化时,会发出该信号。
注: 相应的处理程序是onXSectionChanged
。
ySectionChanged() |
当包含数据点 y 坐标的部分发生变化时,会发出该信号。
注: 相应的处理程序是onYSectionChanged
。
© 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.