QCustomSeries Class
QCustomSeries 클래스를 사용하면 사용자 정의 그래프 유형을 표시할 수 있습니다. 더 보기...
| 헤더: | #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 |
속성
- 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 | setCustomSeriesPainter(QCustomSeriesCanvasRenderer *painter) |
| 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 내에서 정의되며, “data” 속성을 통해 델리게이트된 요소들에 전달됩니다.
액세스 함수:
| QQmlComponent * | delegate() const |
| void | setDelegate(QQmlComponent *newDelegate) |
Notifier 시그널:
| 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 를 참조하십시오.
void QCustomSeries::setCustomSeriesPainter(QCustomSeriesCanvasRenderer *painter)
고성능 캔버스 페인터 백엔드가 사용 중일 때, 이 시리즈를 그리는 데 사용되는 캔버스 페인터 렌더러로 ` painter `를 설정합니다.
QCustomSeries painter 의 소유권을 인수합니다. 이 시리즈가 다음에 동기화될 때 CanvasPainter-backend 렌더러에 의해 채택되며, 이후에는 렌더 스레드에서 렌더러에 의해서만 파기됩니다. 가 직접 파기하는 일은 절대 없습니다. 첫 번째 동기화 전에 가 교체되거나 지워지거나, 이 시리즈가 그 전에 파기되는 경우, 가 직접 이를 삭제합니다. QCustomSeries painter QCustomSeries
[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.