이 페이지에서

QQuickImageResponse Class

QQuickImageResponse 클래스는 ` QQuickAsyncImageProvider`에서 비동기 이미지 로딩을 위한 인터페이스를 제공합니다. 더 보기...

헤더: #include <QQuickImageResponse>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
상속: QObject

공개 함수

QQuickImageResponse()
virtual ~QQuickImageResponse() override
virtual QString errorString() const
virtual QQuickTextureFactory *textureFactory() const = 0

공개 슬롯

virtual void cancel()

신호

void finished()

상세 설명

이미지 응답의 목적은 이미지 공급자 작업을 비동기 방식으로 실행할 수 있는 방법을 제공하는 것입니다.

finished() 신호가 발산되면 deleteLater 을 통해 응답이 삭제됩니다. QQuickImageResponse의 기반으로 QRunnable 를 사용하는 경우, 자동 삭제가 비활성화되어 있는지 확인하십시오.

전체 구현 내용은 ‘이미지 응답 제공자 예제’를 참조하십시오.

QQuickImageProvider도 참조하십시오 .

멤버 함수 문서

QQuickImageResponse::QQuickImageResponse()

이미지 응답을 생성합니다.

[override virtual noexcept] QQuickImageResponse::~QQuickImageResponse()

이미지 응답을 삭제합니다.

[virtual slot] void QQuickImageResponse::cancel()

이 메서드는 엔진에서 더 이상 응답이 필요하지 않음을 알리는 데 사용됩니다.

프로바이더 측에서 요청을 취소하기 위해 이 메서드를 재구현할 수도 있지만, 반드시 그래야 하는 것은 아닙니다.

취소된 QQuickImageResponse 는 엔진이 QQuickImageResponse 를 정리할 수 있도록 finished()를 여전히 발산해야 합니다.

참고: cancel()이 호출되었는지 여부와 관계없이, 응답이 완료될 때까지는finished()을 발송해서는 안 됩니다. 이 메서드가 너무 일찍 호출될 경우, 엔진이 응답이 아직 활성 상태인 동안 이를 파괴하여 충돌을 일으킬 수 있습니다.

[virtual] QString QQuickImageResponse::errorString() const

작업 실행에 대한 오류 문자열을 반환합니다. 빈 문자열은 오류가 없음을 의미합니다.

[signal] void QQuickImageResponse::finished()

작업 실행이 완료되었음을 알리는 신호입니다(성공, 오류 발생, 또는 취소된 경우 모두 포함).

참고: 이 신호의발신은 응답이 수행하는 마지막 작업이어야 합니다. 신호가 수신되면, 응답은 이후 엔진에 의해 소멸됩니다.

[pure virtual] QQuickTextureFactory *QQuickImageResponse::textureFactory() const

작업에 대한 텍스처 팩토리를 반환합니다. 제공자가 ` QImage`와 호환되는 경우 ` QQuickTextureFactory::textureFactoryForImage `를 사용할 수 있습니다. 엔진은 반환된 ` QQuickTextureFactory`에 대한 소유권을 확보합니다.

참고: 이 메서드는 필요한 경우에만 호출됩니다. 예를 들어, 오류가 발생하거나 작업이 취소된 경우에는 호출되지 않을 수 있습니다. 따라서 QQuickTextureFactory 인스턴스는 이 메서드 내에서만 할당하거나, 그렇지 않은 경우 반드시 삭제해야 합니다.

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