QQuickImageResponse Class
QQuickImageResponse 클래스는 QQuickAsyncImageProvider 에서 비동기 이미지 로딩을 위한 인터페이스를 제공합니다. 더 보기...
Header: | #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 을 통해 응답이 삭제됩니다. QRunnable 을 QQuickImageResponse의 기반으로 사용하는 경우 자동 삭제가 비활성화되어 있는지 확인하세요.
전체 구현은 이미지 응답 공급자 예제를 참조하세요.
QQuickImageProvider도 참조하세요 .
멤버 함수 문서
QQuickImageResponse::QQuickImageResponse()
이미지 응답을 구성합니다.
[override virtual noexcept]
QQuickImageResponse::~QQuickImageResponse()
이미지 응답을 파괴합니다.
[virtual slot]
void QQuickImageResponse::cancel()
이 메서드는 엔진에서 더 이상 응답이 필요하지 않음을 알리는 데 사용됩니다.
공급자 측에서 요청을 취소하기 위해 다시 구현할 수 있지만 필수는 아닙니다.
취소된 QQuickImageResponse 는 여전히 finished()를 전송해야 엔진이 QQuickImageResponse 를 정리할 수 있습니다.
참고: finished()는 취소()의 호출 여부와 관계없이 응답이 완료될 때까지 전송해서는 안 됩니다. 너무 일찍 호출되면 엔진이 아직 활성화된 상태에서 응답을 파괴하여 충돌이 발생할 수 있습니다.
[virtual]
QString QQuickImageResponse::errorString() const
작업 실행에 대한 오류 문자열을 반환합니다. 빈 문자열은 오류가 없음을 의미합니다.
[signal]
void QQuickImageResponse::finished()
작업 실행이 완료되었음을 알리는 신호(성공적이든, 오류가 발생했든, 취소되었든).
참고: 이 신호의 방출은 응답이 수행하는 마지막 작업이어야 합니다. 신호가 수신되면 엔진에 의해 응답이 소멸됩니다.
[pure virtual]
QQuickTextureFactory *QQuickImageResponse::textureFactory() const
작업에 대한 텍스처 팩토리를 반환합니다. 공급자가 QImage 을 사용하는 경우 QQuickTextureFactory::textureFactoryForImage 을 사용할 수 있습니다. 엔진은 반환된 QQuickTextureFactory 의 소유권을 갖습니다.
참고: 이 메서드는 필요할 때만 호출됩니다. 예를 들어 오류가 발생하거나 작업이 취소된 경우에는 호출되지 않을 수 있습니다. 따라서 이 메서드에서만 QQuickTextureFactory 인스턴스를 할당하거나 삭제하도록 하세요.
© 2025 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.