QBarModelMapper Class

QBarModelMapper クラスは棒グラフのモデルマッパーです。詳細...

ヘッダー #include <QBarModelMapper>
CMake: find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake QT += graphs
QML で BarModelMapper
継承: QObject

プロパティ

パブリック機能

qsizetype count() const
qsizetype first() const
qsizetype firstBarSetSection() const
qsizetype lastBarSetSection() const
QAbstractItemModel *model() const
Qt::Orientation orientation() const
QBarSeries *series() const
void setCount(qsizetype newCount)
void setFirst(qsizetype newFirst)
void setFirstBarSetSection(qsizetype newFirstBarSetSection)
void setLastBarSetSection(qsizetype newLastBarSetSection)
void setModel(QAbstractItemModel *model)
void setOrientation(Qt::Orientation orientation)
void setSeries(QBarSeries *series)

シグナル

詳細説明

モデルマッパーは、QAbstractItemModel クラスに由来するデータモデルを、グラフのデータソースとして使用できるようにします。モデルマッパーは、データモデルとQBarSeries との間の接続を作成するために使用されます。

モデルと棒グラフの両方のプロパティを使用して、データを操作することができます。モデルマッパーは、棒系列とデータモデルの同期を保ちます。

モデルマッパーは、棒系列内のすべての棒セットのサイズが等しいことを保証します。従って、バーセットに値を追加または削除すると、バーシリーズ内のすべてのバーセットに同じ変更が行われます。

プロパティのドキュメント

count : qsizetype

このプロパティは、棒系列のデータとしてマッピングされるモデルの行数または列数を保持する。

デフォルト値は-1 で、これは最小値でもある。カウントはモデルの行数/列数によって制限されます。

アクセス関数:

qsizetype count() const
void setCount(qsizetype newCount)

通知シグナル:

void countChanged()

QBarModelMapper::orientationも参照のこと

first : qsizetype

このプロパティは、棒系列の棒セットの最初の値を含むモデルの行または列を保持する。

最小値およびデフォルト値は 0 です。

アクセス関数:

qsizetype first() const
void setFirst(qsizetype newFirst)

通知シグナル:

void firstChanged()

QBarModelMapper::orientationも参照してください

firstBarSetSection : qsizetype

このプロパティは、最初のバー・セットのデータ・ソースとして使用されるモデルのセクションを保持します。

デフォルト値は -1(無効なマッピング)です。

アクセス関数:

qsizetype firstBarSetSection() const
void setFirstBarSetSection(qsizetype newFirstBarSetSection)

ノーティファイア・シグナル:

void firstBarSetSectionChanged()

QBarModelMapper::orientationも参照してください

lastBarSetSection : qsizetype

このプロパティは、最後のバー・セットのデータ・ソースとして使用されるモデルのセクションを保持します。

デフォルト値は -1(無効なマッピング)です。

アクセス関数:

qsizetype lastBarSetSection() const
void setLastBarSetSection(qsizetype newLastBarSetSection)

ノーティファイア・シグナル:

void lastBarSetSectionChanged()

QBarModelMapper::orientationも参照してください

model : QAbstractItemModel*

このプロパティはマッパーが使用するデータモデルを保持する。

アクセス関数

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

通知シグナル

void modelChanged()

orientation : Qt::Orientation

モデルからのデータをどのようにマッピングするかをモデルマッパーに指示します。Qt::Vertical が使用されている場合、モデルの各列はバーセットを定義し、モデルの行はカテゴリを定義します。Orientation がQt::Horizontal に設定されている場合、モデルの各行がバーセットを定義し、モデルの列がカテゴリを定義します。

デフォルト値はQt::Vertical

アクセス関数:

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

通知シグナル:

void orientationChanged()

series : QBarSeries*

このプロパティはマッパーが使用するバー系列を保持する。

このシリーズがマッパーに設定されると、シリーズ内のデータはすべて破棄されます。新しい系列が指定されると、古い系列は切り離されますが、そのデータは保持されます。

アクセス関数

QBarSeries *series() const
void setSeries(QBarSeries *series)

通知シグナル

void seriesChanged()

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