QItemModelScatterDataProxy Class
Q3DScatter 를 사용하여 항목 모델의 데이터를 표시하기 위한 프록시 클래스. 더 보기...
| 헤더: | #include <QItemModelScatterDataProxy> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS DataVisualization) target_link_libraries(mytarget PRIVATE Qt6::DataVisualization) |
| qmake: | QT += datavisualization |
| 출시일: | QtDataVisualization 1.0 |
| 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() |
| 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 에서 파생된 모델을 Q3DScatter 의 데이터 소스로 활용할 수 있습니다. 이 프로キシ는 QAbstractItemModel 의 역할을 Q3DScatter 점의 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 의 ‘Simple Bar Graph’ 예제를 참조하십시오.
Qt Data Visualization 데이터 처리항목도 참조하십시오 .
속성 문서
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) |
rotationRole 및 rotationRoleReplace도 참조하십시오 .
rotationRoleReplace : QString
이 속성은 회전 역할 패턴과 함께 사용될 대체 내용을 저장합니다.
기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 치환이 어떻게 작동하는지에 대한 자세한 내용은 QString::replace(const QRegularExpression &rx, const QString &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) |
알림 신호:
| void | xPosRolePatternChanged(const QRegularExpression &pattern) |
xPosRole 및 xPosRoleReplace도 참조하십시오 .
xPosRoleReplace : QString
이 속성은 x 위치 역할 패턴과 함께 사용될 대체 내용을 저장합니다.
기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 바꾸기 기능에 대한 자세한 내용은 ` QString::replace(const QRegularExpression &rx, const QString &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) |
알림 신호:
| void | yPosRolePatternChanged(const QRegularExpression &pattern) |
yPosRole 및 yPosRoleReplace도 참조하십시오 .
yPosRoleReplace : QString
이 속성은 y 위치 역할 패턴과 함께 사용될 대체 내용을 저장합니다.
기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 치환이 어떻게 작동하는지에 대한 자세한 내용은 QString::replace(const QRegularExpression &rx, const QString &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) |
알림 신호:
| void | zPosRolePatternChanged(const QRegularExpression &pattern) |
zPosRole 및 zPosRoleReplace도 참조하십시오 .
zPosRoleReplace : QString
이 속성은 z 위치 역할 패턴과 함께 사용될 대체 내용을 저장합니다.
기본값은 빈 문자열입니다. 정규식을 사용한 검색 및 바꾸기 기능의 작동 방식에 대한 자세한 내용은 QString::replace(const QRegularExpression &rx, const QString &after) 함수 설명서를 참조하십시오.
액세스 함수:
| QString | zPosRoleReplace() const |
| void | setZPosRoleReplace(const QString &replace) |
알림 신호:
| void | zPosRoleReplaceChanged(const QString &replace) |
zPosRole 및 zPosRolePattern도 참조하십시오 .
멤버 함수 문서
[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 로 설정됩니다.
[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)
itemModel 를 Q3DScatter의 항목 모델로 설정합니다. 모델의 소유권을 가져오지는 않지만, 모델에 연결하여 변경 사항을 감지합니다.
참고: itemModel 속성에 대한세터 함수입니다.
itemModel()도 참조하십시오 .
© 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.