QItemModelScatterDataProxy Class
アイテムモデルのデータをQ3DScatterWidgetItem で表示するためのプロキシ・クラスです。もっと見る...
ヘッダ | #include <QItemModelScatterDataProxy> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
qmake | QT += graphs |
QML で | ItemModelScatterDataProxy |
継承: | QScatterDataProxy |
- 継承メンバを含む全メンバのリスト
- QItemModelScatterDataProxy はQt Graphs C++ Classes for 3D に含まれます。
プロパティ
|
|
パブリック機能
QItemModelScatterDataProxy(QObject *parent = nullptr) | |
QItemModelScatterDataProxy(QAbstractItemModel *itemModel, QObject *parent = nullptr) | |
QItemModelScatterDataProxy(QAbstractItemModel *itemModel, const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, QObject *parent = nullptr) | |
QItemModelScatterDataProxy(QAbstractItemModel *itemModel, const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, const QString &rotationRole, QObject *parent = nullptr) | |
virtual | ~QItemModelScatterDataProxy() override |
QAbstractItemModel * | itemModel() const |
void | remap(const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, const QString &rotationRole) |
QString | rotationRole() const |
QRegularExpression | rotationRolePattern() const |
QString | rotationRoleReplace() const |
void | setItemModel(QAbstractItemModel *itemModel) |
void | setRotationRole(const QString &role) |
void | setRotationRolePattern(const QRegularExpression &pattern) |
void | setRotationRoleReplace(const QString &replace) |
void | setXPosRole(const QString &role) |
void | setXPosRolePattern(const QRegularExpression &pattern) |
void | setXPosRoleReplace(const QString &replace) |
void | setYPosRole(const QString &role) |
void | setYPosRolePattern(const QRegularExpression &pattern) |
void | setYPosRoleReplace(const QString &replace) |
void | setZPosRole(const QString &role) |
void | setZPosRolePattern(const QRegularExpression &pattern) |
void | setZPosRoleReplace(const QString &replace) |
QString | xPosRole() const |
QRegularExpression | xPosRolePattern() const |
QString | xPosRoleReplace() const |
QString | yPosRole() const |
QRegularExpression | yPosRolePattern() const |
QString | yPosRoleReplace() const |
QString | zPosRole() const |
QRegularExpression | zPosRolePattern() const |
QString | zPosRoleReplace() const |
シグナル
void | itemModelChanged(const QAbstractItemModel *itemModel) |
void | rotationRoleChanged(const QString &role) |
void | rotationRolePatternChanged(const QRegularExpression &pattern) |
void | rotationRoleReplaceChanged(const QString &replace) |
void | xPosRoleChanged(const QString &role) |
void | xPosRolePatternChanged(const QRegularExpression &pattern) |
void | xPosRoleReplaceChanged(const QString &replace) |
void | yPosRoleChanged(const QString &role) |
void | yPosRolePatternChanged(const QRegularExpression &pattern) |
void | yPosRoleReplaceChanged(const QString &replace) |
void | zPosRoleChanged(const QString &role) |
void | zPosRolePatternChanged(const QRegularExpression &pattern) |
void | zPosRoleReplaceChanged(const QString &replace) |
詳細説明
QItemModelScatterDataProxy を使用すると、Q3DScatterWidgetItem のデータソースとしてQAbstractItemModel 派生モデルを使用できます。これは、QAbstractItemModel のロールをQ3DScatterWidgetItem ポイントの XYZ 値にマッピングします。
マッピングやモデルが変更されるたびに、データは非同期に解決されます。QScatterDataProxy::arrayResetデータが解決されると()が出力されます。しかし、挿入、削除、およびモデル初期化後の単一データ項目の変更は、同じフレームにモデル全体を解決するような変更が含まれていない限り、同期的に解決されます。
マッピングはQAbstractItemModel の行や列を無視し、全ての項目を平等に扱います。モデルには、散布点のX、Y、Z値にマッピングできるデータ項目のロールを提供する必要があります。
例えば、材料サンプルで行われた様々な測定を保存するためのカスタムQAbstractItemModel 、「密度」、「硬度」、「導電率」などの役割のデータを提供するとします。このプロキシを使用して、散布図上でこれらの特性を可視化することができます:
// Map "density" value to X-axis, "hardness" to Y-axis and "conductivity" to Z-axis. QItemModelScatterDataProxy *proxy = new QItemModelScatterDataProxy(customModel, QStringLiteral("density"), QStringLiteral("hardness"), QStringLiteral("conductivity"));
モデルのフィールドに必要な形式のデータが含まれていない場合、検索パターンの正規表現と各ロールの置換ルールを指定することで、必要な形式の値を得ることができます。正規表現を使用した置換がどのように動作するかの詳細については、QString::replace(constQRegularExpression &rx, constQString &after)関数のドキュメントを参照してください。正規表現の使用はパフォーマンスに影響を与えるので、目的の値を得るために検索と置換を行う必要がない項目モデルを利用する方が効率的であることに注意してください。
ロールと組み合わせて検索パターンを使用する例については、ItemModelBarDataProxy 「Simple Bar Graph」での使用法を参照してください。
また、 Qt Graphs 3Dによるデータ処理も参照してください。
プロパティのドキュメント
itemModel : QAbstractItemModel*
このプロパティは、3D 散布図系列のデータソースとして使用する項目モデルを保持する。
アクセス関数
QAbstractItemModel * | itemModel() const |
void | setItemModel(QAbstractItemModel *itemModel) |
通知シグナル
void | itemModelChanged(const QAbstractItemModel *itemModel) |
rotationRole : QString
このプロパティは、アイテムの回転にマッピングするアイテムモデルの役割を保持する。
モデルは、QQuaternion に直接変換可能なバリアントとして、または文字列表現の 1 つとして rotation の値を提供することができます:"scalar,x,y,z"
または"@angle,x,y,z"
。 前者は、指定された値で直接クォータニオンを構築し、後者は、QQuaternion::fromAxisAndAngle() メソッドを使用してクォータニオンを構築します。
アクセス関数
QString | rotationRole() const |
void | setRotationRole(const QString &role) |
通知シグナル:
void | rotationRoleChanged(const QString &role) |
rotationRolePattern : QRegularExpression
このプロパティは、アイテムのローテーションとして使用する前に、ローテーションロールによってマップされた値に対して検索と置換を行うかどうかを保持する。
このプロパティには、マップされた値の置換する部分を検索するための正規表現が指定され、rotationRoleReplace プロパティには置換文字列が格納されます。
アクセス関数:
QRegularExpression | rotationRolePattern() const |
void | setRotationRolePattern(const QRegularExpression &pattern) |
Notifier シグナル:
void | rotationRolePatternChanged(const QRegularExpression &pattern) |
rotationRole およびrotationRoleReplaceも参照のこと 。
rotationRoleReplace : QString
このプロパティは、回転ロールパターンと組み合わせて使用される置換内容を保持する。
デフォルトは空文字列です。正規表現による検索と置換の動作の詳細については、QString::replace(constQRegularExpression &rx, constQString &after)関数のドキュメントを参照してください。
アクセス関数:
QString | rotationRoleReplace() const |
void | setRotationRoleReplace(const QString &replace) |
通知シグナル:
void | rotationRoleReplaceChanged(const QString &replace) |
rotationRole およびrotationRolePatternも参照のこと 。
xPosRole : QString
このプロパティは、X 位置にマッピングするアイテムモデルの役割を保持する。
アクセス関数
QString | xPosRole() const |
void | setXPosRole(const QString &role) |
通知シグナル
void | xPosRoleChanged(const QString &role) |
xPosRolePattern : QRegularExpression
このプロパティは、項目位置値として使用する前に、x 位置ロールによってマップされた値に対して検索と置換を行うかどうかを保持する。
このプロパティには、マップされた値の置換する部分を検索するための正規表現が指定され、xPosRoleReplace プロパティには置換文字列が格納される。
アクセス関数:
QRegularExpression | xPosRolePattern() const |
void | setXPosRolePattern(const QRegularExpression &pattern) |
Notifier シグナル:
void | xPosRolePatternChanged(const QRegularExpression &pattern) |
xPosRole およびxPosRoleReplaceも参照のこと 。
xPosRoleReplace : QString
このプロパティは、x位置ロールパターンと組み合わせて使用される置換内容を保持する。
デフォルトは空文字列です。正規表現による検索と置換の動作の詳細については、QString::replace(constQRegularExpression &rx, constQString &after)関数のドキュメントを参照してください。
アクセス関数:
QString | xPosRoleReplace() const |
void | setXPosRoleReplace(const QString &replace) |
通知シグナル:
void | xPosRoleReplaceChanged(const QString &replace) |
xPosRole およびxPosRolePatternも参照のこと 。
yPosRole : QString
このプロパティは、Y 位置に対応付けるアイテムモデルの役割を保持する。
アクセス関数
QString | yPosRole() const |
void | setYPosRole(const QString &role) |
通知シグナル
void | yPosRoleChanged(const QString &role) |
yPosRolePattern : QRegularExpression
このプロパティは、項目位置値として使用される前に、y 位置ロールによってマップされた値に対して検索と置換が行われるかどうかを保持する。
このプロパティには、マップされた値の置換する部分を検索するための正規表現が指定され、yPosRoleReplace プロパティには置換文字列が格納される。
アクセス関数:
QRegularExpression | yPosRolePattern() const |
void | setYPosRolePattern(const QRegularExpression &pattern) |
Notifier シグナル:
void | yPosRolePatternChanged(const QRegularExpression &pattern) |
yPosRole およびyPosRoleReplaceも参照のこと 。
yPosRoleReplace : QString
このプロパティは、y位置ロールパターンと組み合わせて使用される置換内容を保持する。
デフォルトは空文字列です。正規表現による検索と置換の動作の詳細については、QString::replace(constQRegularExpression &rx, constQString &after)関数のドキュメントを参照してください。
アクセス関数:
QString | yPosRoleReplace() const |
void | setYPosRoleReplace(const QString &replace) |
通知シグナル:
void | yPosRoleReplaceChanged(const QString &replace) |
yPosRole およびyPosRolePatternも参照のこと 。
zPosRole : QString
このプロパティは、Z 位置に対応付けるアイテムモデルの役割を保持する。
アクセス関数
QString | zPosRole() const |
void | setZPosRole(const QString &role) |
通知シグナル
void | zPosRoleChanged(const QString &role) |
zPosRolePattern : QRegularExpression
このプロパティは、項目位置値として使用される前に、z 位置ロールによってマップされた値に対して検索と置換が行われるかどうかを保持する。
このプロパティには、マップされた値の置換する部分を検索するための正規表現が指定され、zPosRoleReplace プロパティには置換文字列が格納される。
アクセス関数:
QRegularExpression | zPosRolePattern() const |
void | setZPosRolePattern(const QRegularExpression &pattern) |
Notifier シグナル:
void | zPosRolePatternChanged(const QRegularExpression &pattern) |
zPosRole およびzPosRoleReplaceも参照のこと 。
zPosRoleReplace : QString
このプロパティは、zポジション役割パターンと組み合わせて使用される置換内容を保持する。
デフォルトは空文字列です。正規表現による検索と置換の動作の詳細については、QString::replace(constQRegularExpression &rx, constQString &after)関数のドキュメントを参照してください。
アクセス関数:
QString | zPosRoleReplace() const |
void | setZPosRoleReplace(const QString &replace) |
通知シグナル:
void | zPosRoleReplaceChanged(const QString &replace) |
zPosRole およびzPosRolePatternも参照のこと 。
メンバ関数のドキュメント
[explicit]
QItemModelScatterDataProxy::QItemModelScatterDataProxy(QObject *parent = nullptr)
QItemModelScatterDataProxy をオプションのparent で構築します。
[explicit]
QItemModelScatterDataProxy::QItemModelScatterDataProxy(QAbstractItemModel *itemModel, QObject *parent = nullptr)
QItemModelScatterDataProxy をitemModel とオプションのparent で構築します。通常、アイテムモデルは他のコントロールによって所有されるため、プロキシはitemModel の所有権を持ちません。
[explicit]
QItemModelScatterDataProxy::QItemModelScatterDataProxy(QAbstractItemModel *itemModel, const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, QObject *parent = nullptr)
QItemModelScatterDataProxy をitemModel とオプションのparent で構築します。アイテム・モデルは通常、他のコントロールによって所有されるため、プロキシはitemModel の所有権を取りません。xPosRole プロパティはxPosRole に、yPosRole プロパティはyPosRole に、zPosRole プロパティはzPosRole に設定されます。
[explicit]
QItemModelScatterDataProxy::QItemModelScatterDataProxy(QAbstractItemModel *itemModel, const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, const QString &rotationRole, QObject *parent = nullptr)
QItemModelScatterDataProxy をitemModel とオプションのparent で構築します。アイテム・モデルは通常、他のコントロールによって所有されるため、プロキシはitemModel の所有権を取りません。xPosRole プロパティはxPosRole に、yPosRole プロパティはyPosRole に、zPosRole プロパティはzPosRole に、rotationRole プロパティはrotationRole に設定されます。
[override virtual noexcept]
QItemModelScatterDataProxy::~QItemModelScatterDataProxy()
QItemModelScatterDataProxy を破壊する。
void QItemModelScatterDataProxy::remap(const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, const QString &rotationRole)
xPosRole,yPosRole,zPosRole,rotationRole のマッピングを変更。
void QItemModelScatterDataProxy::setItemModel(QAbstractItemModel *itemModel)
Q3DScatterWidgetItem のアイテムモデルとしてitemModel を設定します。モデルの所有権は取得しませんが、変更をリッスンするためにモデルに接続します。
注: プロパティitemModel のセッター関数です。
itemModel()も参照してください 。
© 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.