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(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를 사용하면 QAbstractItemModel 파생 모델을 Q3DScatterWidgetItem 의 데이터 소스로 사용할 수 있습니다. 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(const QRegularExpression &rx, const QString &after) 함수 설명서를 참조하세요. 정규식을 사용하면 성능에 영향을 미치므로 원하는 값을 얻기 위해 검색 및 바꾸기를 수행할 필요가 없는 항목 모델을 활용하는 것이 더 효율적이라는 점에 유의하세요.

검색 패턴을 역할과 함께 사용하는 방법에 대한 예는 간단한 막대 그래프에서 ItemModelBarDataProxy 사용법을 참조하세요.

또한 Qt Graphs 3D로 데이터 처리하기를참조하세요 .

속성 문서

itemModel : QAbstractItemModel*

이 속성에는 3D 스캐터 계열의 데이터 소스로 사용할 항목 모델이 저장됩니다.

함수에 액세스합니다:

QAbstractItemModel *itemModel() const
void setItemModel(QAbstractItemModel *itemModel)

알림 신호:

void itemModelChanged(const QAbstractItemModel *itemModel)

rotationRole : QString

이 속성은 항목 로테이션에 매핑할 항목 모델 역할을 보유합니다.

모델은 회전 값을 QQuaternion 로 직접 변환할 수 있는 변형 또는 문자열 표현 중 하나인 "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)

알림 신호:

void rotationRolePatternChanged(const QRegularExpression &pattern)

rotationRolerotationRoleReplace참조하세요 .

rotationRoleReplace : QString

이 속성은 회전 역할 패턴과 함께 사용할 바꾸기 콘텐츠를 저장합니다.

기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 바꾸기 작동 방식에 대한 자세한 내용은 QString::replace(const QRegularExpression &rx, const QString &after) 함수 설명서를 참조하세요.

액세스 함수

QString rotationRoleReplace() const
void setRotationRoleReplace(const QString &replace)

알림 신호:

void rotationRoleReplaceChanged(const QString &replace)

rotationRolerotationRolePattern참조하세요 .

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)

알림 신호:

void xPosRolePatternChanged(const QRegularExpression &pattern)

xPosRolexPosRoleReplace참조하세요 .

xPosRoleReplace : QString

이 속성은 x 위치 역할 패턴과 함께 사용할 바꾸기 콘텐츠를 보유합니다.

기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 바꾸기 작동 방식에 대한 자세한 내용은 QString::replace(const QRegularExpression &rx, const QString &after) 함수 설명서를 참조하세요.

액세스 함수

QString xPosRoleReplace() const
void setXPosRoleReplace(const QString &replace)

알림 신호:

void xPosRoleReplaceChanged(const QString &replace)

xPosRolexPosRolePattern참조하세요 .

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)

알림 신호:

void yPosRolePatternChanged(const QRegularExpression &pattern)

yPosRoleyPosRoleReplace참조하세요 .

yPosRoleReplace : QString

이 속성은 y 위치 역할 패턴과 함께 사용할 바꾸기 콘텐츠를 보유합니다.

기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 바꾸기 작동 방식에 대한 자세한 내용은 QString::replace(const QRegularExpression &rx, const QString &after) 함수 설명서를 참조하세요.

액세스 함수

QString yPosRoleReplace() const
void setYPosRoleReplace(const QString &replace)

알림 신호:

void yPosRoleReplaceChanged(const QString &replace)

yPosRoleyPosRolePattern참조하세요 .

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)

알림 신호:

void zPosRolePatternChanged(const QRegularExpression &pattern)

zPosRolezPosRoleReplace참조하세요 .

zPosRoleReplace : QString

이 속성에는 z 위치 역할 패턴과 함께 사용할 대체 콘텐츠가 저장됩니다.

기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 바꾸기 작동 방식에 대한 자세한 내용은 QString::replace(const QRegularExpression &rx, const QString &after) 함수 설명서를 참조하세요.

액세스 함수

QString zPosRoleReplace() const
void setZPosRoleReplace(const QString &replace)

알림 신호:

void zPosRoleReplaceChanged(const QString &replace)

zPosRolezPosRolePattern참조하세요 .

멤버 함수 문서

[explicit] QItemModelScatterDataProxy::QItemModelScatterDataProxy(QObject *parent = nullptr)

선택 사항 parent 을 사용하여 QItemModelScatterDataProxy 를 구축합니다.

[explicit] QItemModelScatterDataProxy::QItemModelScatterDataProxy(QAbstractItemModel *itemModel, QObject *parent = nullptr)

itemModel 와 선택 사항인 parent 으로 QItemModelScatterDataProxy를 구성합니다. 일반적으로 아이템 모델은 다른 컨트롤이 소유하므로 프록시는 itemModel 에 대한 소유권을 갖지 않습니다.

[explicit] QItemModelScatterDataProxy::QItemModelScatterDataProxy(QAbstractItemModel *itemModel, const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, QObject *parent = nullptr)

itemModel 와 선택 사항인 parent 으로 QItemModelScatterDataProxy를 구성합니다. 일반적으로 항목 모델은 다른 컨트롤이 소유하므로 프록시는 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)

itemModel 와 선택 사항인 parent 으로 QItemModelScatterDataProxy를 구성합니다. 일반적으로 항목 모델은 다른 컨트롤이 소유하므로 프록시는 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)

itemModelQ3DScatterWidgetItem 의 항목 모델로 설정합니다. 모델의 소유권을 가지지는 않지만 모델에 연결하여 변경 사항을 수신합니다.

참고: 속성에 대한 설정자 함수 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.