QCustomSeriesCanvasRenderer Class
QCustomSeriesCanvasRenderer 클래스를 사용하면 고성능 캔버스 페인터 백엔드가 사용 중일 때 QCustomSeries 에 대한 사용자 정의 렌더링을 구현할 수 있습니다. 더 보기...
| 헤더: | #include <QCustomSeriesCanvasRenderer> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| 다음부터: | Qt 6.12부터 |
공개 함수
| QCustomSeriesCanvasRenderer() | |
| virtual void | canvasPrePaint(QCanvasPainter *p) |
| virtual void | initializeResources(QCustomSeries *series, QCanvasPainter *p) |
| virtual void | synchronizeData(QCustomSeries *series, QCanvasPainterItem *item) |
상세 설명
QCustomSeries 를 그리려면 canvasPaint()를 구현하십시오. QCustomSeries::setCustomSeriesPainter()를 사용하여 시리즈에 렌더러를 설정하면, 시리즈는 이를 QCustomSeries::customSeriesPainter()를 통해 노출합니다.
canvasPaint()와 canvasPrePaint() 는Qt Quick 의 씬 그래프 렌더링 스레드에서 호출되며, initializeResources() 및 synchronizeData()와 달리, 해당 함수가 속한 QCustomSeries 를 수신하지 않습니다. canvasPaint()에 필요한 모든 내용은 synchronizeData()의 렌더러 인스턴스로 복사하십시오. 이 함수는 GUI 스레드가 차단된 상태에서 실행되며, GUI 스레드 데이터를 안전하게 읽을 수 있는 유일한 장소입니다.
QCustomSeries 와 QCustomSeries::setCustomSeriesPainter()도 참조하십시오 .
멤버 함수 문서
[constexpr noexcept default] QCustomSeriesCanvasRenderer::QCustomSeriesCanvasRenderer()
QCustomSeriesCanvasRenderer 의 인스턴스를 기본 생성합니다.
[virtual] void QCustomSeriesCanvasRenderer::canvasPrePaint(QCanvasPainter *p)
이 메서드를 재구현하여, synchronizeData()에 의해 이 인스턴스로 미리 복사된 상태를 기반으로 p 를 사용하여 렌더링을 준비하십시오. 이 메서드는 렌더링 스레드에서 동일한 인스턴스에 대한 canvasPaint()가 호출되기 직전에 호출되므로, 여기서 시리즈나 항목 상태에 접근해서는 안 됩니다.
canvasPaint()도 참조하십시오 .
[virtual] void QCustomSeriesCanvasRenderer::initializeResources(QCustomSeries *series, QCanvasPainter *p)
p 를 사용하여 series 의 리소스를 초기화하려면 이 메서드를 재구현하십시오. 이 메서드는 series 에 대한 첫 번째 synchronizeData() 호출 전에 한 번 호출됩니다.
QCanvasPainter ::addImage 및 QCanvasPainter::createCanvas도 참조하십시오 .
[virtual] void QCustomSeriesCanvasRenderer::synchronizeData(QCustomSeries *series, QCanvasPainterItem *item)
이 메서드를 재구현하여 item 에서 series 을 그리는 데 필요한 데이터를 이 렌더러 인스턴스로 복사하십시오. 이 메서드는 series 이 다시 그려져야 할 때마다 canvasPaint()가 호출되기 전에 호출됩니다.
이 메서드는 GUI 스레드가 Qt Quick 동기화 지점에서 차단된 상태에서 실행되므로, series 또는 item 의 GUI 소유 상태를 직접 읽어도 안전한 유일한 곳입니다. canvasPaint()나 canvasPrePaint()에서는 해당 상태에 접근하지 마십시오.
© 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.