QXYModelMapper Class

The QXYModelMapper class is a model mapper for line, spline, and scatter series. 更多...

頭: #include <QXYModelMapper>
CMake: find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake: QT += graphs
在 QML: XYModelMapper
繼承: QObject

特性

公共函數

qsizetype count () const
qsizetype first () const
QAbstractItemModel * model () const
Qt::Orientation orientation () const
QXYSeries * series () const
void setCount (qsizetype count )
void setFirst (qsizetype first )
void setModel (QAbstractItemModel * model )
void setOrientation (Qt::Orientation orientation )
void setSeries (QXYSeries * series )
void setXSection (qsizetype xSection )
void setYSection (qsizetype ySection )
qsizetype xSection () const
qsizetype ySection () const

信號

void countChanged ()
void firstChanged ()
void modelChanged ()
void orientationChanged ()
void seriesChanged ()
void xSectionChanged ()
void ySectionChanged ()

詳細描述

模型映射器允許使用的數據模型派生自 QAbstractItemModel class as a data source for a graph. A model mapper is used to create a connection between a line, spline, or scatter series. A TableModel is a natural choice for the model.

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

另請參閱 QXYSeries .

特性文檔編製

count : qsizetype

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

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

訪問函數:

qsizetype count () const
void setCount (qsizetype count )

通知程序信號:

void countChanged ()

另請參閱 QXYModelMapper::orientation .

第一 : qsizetype

This property holds the row of the model that contains the data for the first point of the series.

最小且默認值為 0。

訪問函數:

qsizetype 第一 () const
void setFirst (qsizetype first )

通知程序信號:

void firstChanged ()

另請參閱 QXYModelMapper::orientation .

model : QAbstractItemModel *

此特性保持映射器使用的模型。

訪問函數:

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

通知程序信號:

void modelChanged ()

orientation : Qt::Orientation

Tells the modelmapper how to map data from a model. If Qt::Vertical is used, each of the model's columns defines a bar set, and the model's rows define the categories. When the orientation is set to Qt::Horizontal , each of the model's rows defines a bar set, and the model's columns define categories.

默認值為 Qt::Vertical

訪問函數:

Qt::Orientation orientation () const
void setOrientation (Qt::Orientation orientation )

通知程序信號:

void orientationChanged ()

series : QXYSeries *

This property holds the 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).

訪問函數:

QXYSeries * series () const
void setSeries (QXYSeries * series )

通知程序信號:

void seriesChanged ()

xSection : qsizetype

This property holds the section of the model that contains the x-coordinates of data points.

默認值為 -1 (無效映射)。

訪問函數:

qsizetype xSection () const
void setXSection (qsizetype xSection )

通知程序信號:

void xSectionChanged ()

另請參閱 QXYModelMapper::orientation .

ySection : qsizetype

This property holds the section of the model that contains the y-coordinates of data points.

默認值為 -1 (無效映射)。

訪問函數:

qsizetype ySection () const
void setYSection (qsizetype ySection )

通知程序信號:

void ySectionChanged ()

另請參閱 QXYModelMapper::orientation .