このページでは

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 が使用される場合、モデルの各列が棒グラフセットを定義し、モデルの各行がカテゴリを定義します。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()

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