QCustomSeries Class
QCustomSeries 클래스를 사용하면 사용자 지정 그래프 유형을 표시할 수 있습니다. 더 보기...
| Header: | #include <QCustomSeries> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs)target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| 이후: | Qt 6.11 |
| QML에서: | CustomSeries |
| 상속합니다: | QAbstractSeries |
Properties
- delegate : QQmlComponent*
공용 기능
| void | append() |
| void | append(const QVariantMap &data) |
| QQmlComponent * | delegate() const |
| void | insert(qsizetype index) |
| void | insert(qsizetype index, const QVariantMap &data) |
| qreal | mapX(qreal x) |
| qreal | mapY(qreal y) |
| void | remove(qsizetype index) |
| void | setDelegate(QQmlComponent *newDelegate) |
공용 슬롯
| void | clear() |
신호
| void | delegateChanged() |
보호된 기능
| virtual void | updateDelegate(QQuickItem *item, qsizetype index) |
상세 설명
QCustomSeries를 사용하여 사용자 지정 그래프를 만들 수 있습니다. 각 요소에 대한 커스텀 데이터에 액세스할 수 있는 스캐터 그래프라고 생각하면 됩니다.
QCustomSeries는 그래프에 추가된 모든 항목을 렌더링하는 데 사용되는 델리게이트를 정의합니다. 각 항목에는 QVariantMap 에 저장된 사용자 정의 데이터가 포함됩니다. 그래프에 있는 항목의 인덱스도 데이터 맵에 자동으로 추가됩니다. 시리즈는 이 맵을 델리게이트를 기반으로 생성된 각 요소에 전달합니다. 델리게이트는 데이터 사용 방법을 결정합니다.
데이터를 QGraphsView 축으로 정의된 렌더링 좌표에 매핑하려면 mapX 및 mapY 함수를 사용합니다.
참고: 현재 사용자 지정 시리즈의 개별 요소는 서로 정보를 공유하지 않습니다. 따라서 사용자 정의 선 시리즈를 구현할 수 없습니다.
속성 문서
delegate : QQmlComponent*
델리게이트는 제공된 사용자 지정 데이터에 해당하는 요소를 QML에 삽입하는 데 사용됩니다. 데이터는 CustomSeries 자체에 정의되며 '데이터' 속성을 통해 위임된 요소에 제공됩니다.
액세스 함수:
| QQmlComponent * | delegate() const |
| void | setDelegate(QQmlComponent *newDelegate) |
알림 신호:
| void | delegateChanged() |
멤버 함수 문서
[invokable] void QCustomSeries::append()
빈 데이터 항목을 시리즈에 추가합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable] void QCustomSeries::append(const QVariantMap &data)
data 에 정의된 데이터 항목을 시리즈에 추가합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[slot] void QCustomSeries::clear()
모든 데이터 항목을 지웁니다.
[invokable] void QCustomSeries::insert(qsizetype index)
index 위치에 빈 데이터 항목을 시리즈에 추가합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable] void QCustomSeries::insert(qsizetype index, const QVariantMap &data)
data 에 정의된 데이터 항목을 index 위치의 시리즈에 추가합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable] qreal QCustomSeries::mapX(qreal x)
렌더링 공간으로 변환된 x 축 공간 좌표를 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.
[invokable] qreal QCustomSeries::mapY(qreal y)
렌더링 공간으로 변환된 y 축 공간 좌표를 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.
[invokable] void QCustomSeries::remove(qsizetype index)
index 위치에서 데이터 항목을 제거합니다.
참고: 이 함수는 메타객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[virtual protected] void QCustomSeries::updateDelegate(QQuickItem *item, qsizetype index)
그래프 렌더러가 호출하여 데이터를 나타내는 item 및 데이터 항목에 해당하는 index 에 대한 액세스 권한을 부여합니다.
QQuickItem 인스턴스에 대한 커스텀 프로퍼티 값을 구현하려면 재정의합니다.
© 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.