이 페이지에서

Qt3DRender::QPaintedTextureImage Class

class Qt3DRender::QPaintedTextureImage

QPainter 를 통해 작성할 수 있는 QAbstractTextureImage. 더 보기...

헤더: #include <qpaintedtextureimage.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
상속: Qt3DRender::QAbstractTextureImage
상태: 사용 중단됨

이 클래스는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 클래스를 사용하지 않는 것을 강력히 권장합니다.

속성

공개 함수

int height() const
QSize size() const
void update(const QRect &rect = QRect())
int width() const

공개 슬롯

void setHeight(int h)
void setSize(QSize size)
void setWidth(int w)

신호

void heightChanged(int w)
void sizeChanged(QSize size)
void widthChanged(int w)

보호된 함수

virtual void paint(QPainter *painter) = 0

상세 설명

QPaintedTextureImage는 QPainter 를 통해 텍스처 이미지(즉, OpenGL 텍스처)를 지정하는 방법을 제공합니다. 텍스처 이미지의 너비와 높이는 width, height 또는 size 속성을 통해 지정할 수 있습니다.

QPaintedTextureImage는 서브클래스로 구현되어야 하며, 가상 함수 paint()을 구현해야 합니다. QPaintedTextureImage에서 update()가 호출될 때마다 paint() 함수가 호출되고, 그 결과 이미지가 업로드됩니다.

QPaintedTextureImage는 반드시 어떤 QAbstractTexture 에 연결되어 있어야 합니다.

속성 문서

height : int

이 속성은 텍스처 이미지의 높이를 나타냅니다. 높이는 1 이상이어야 합니다.

액세스 함수:

int height() const
void setHeight(int h)

알림 신호:

void heightChanged(int w)

size : QSize

이 속성은 텍스처 이미지의 크기를 나타냅니다.

액세스 함수:

QSize size() const
void setSize(QSize size)

알림 신호:

void sizeChanged(QSize size)

height 및 width도 참조하십시오 .

width : int

이 속성은 텍스처 이미지의 너비를 나타냅니다. 너비는 1 이상이어야 합니다.

액세스 함수:

int width() const
void setWidth(int w)

알림 신호:

void widthChanged(int w)

멤버 함수 설명서

[pure virtual protected] void QPaintedTextureImage::paint(QPainter *painter)

지정된 QPainter 객체 painter 를 사용하여 텍스처 이미지를 그립니다.

QPainter 이미지의 왼쪽 상단 모서리를 원점으로 간주하는 반면, OpenGL은 텍스처의 왼쪽 하단 모서리를 원점으로 간주합니다. 이 차이를 쉽게 해결하는 방법은 다른 그리기 작업을 수행하기 전에 페인터에 사용자 정의 뷰포트를 설정하는 것입니다:

painter->setViewport(0, height(), width(), -height());
...

[slot] void QPaintedTextureImage::setHeight(int h)

텍스처 이미지의 높이(h)를 설정합니다. 크기가 변경되면 업데이트가 트리거됩니다.

참고: height 속성에 대한세터 함수입니다.

height()도 참조하십시오 .

[slot] void QPaintedTextureImage::setSize(QSize size)

텍스처 이미지의 너비와 높이를 설정합니다. size 가 변경되면 업데이트를 트리거합니다.

참고: size 속성에 대한설정 함수입니다.

size()도 참조하십시오 .

[slot] void QPaintedTextureImage::setWidth(int w)

텍스처 이미지의 너비(w)를 설정합니다. 크기가 변경되면 업데이트가 트리거됩니다.

참고: width 속성에 대한세터 함수입니다.

width()도 참조하십시오 .

void QPaintedTextureImage::update(const QRect &rect = QRect())

페인트된 텍스처의 ` paint()` 함수를 즉시 호출하며, 이 함수는 새로운 이미지를 GPU로 업로드합니다. 페인트된 텍스처에 여러 번 변경을 가하는 경우, 필요한 재페인트 횟수를 최소화하기 위해 모든 변경이 완료될 때까지 기다린 후 `update`를 호출하는 것이 좋습니다.

rect 매개변수는 현재 사용되지 않습니다.

© 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.