QQuickAsyncImageProvider Class

Die Klasse QQuickAsyncImageProvider bietet eine Schnittstelle zur asynchronen Steuerung von QML-Bildanforderungen. Mehr...

Kopfzeile: #include <QQuickAsyncImageProvider>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Vererbungen: QQuickImageProvider

Öffentliche Funktionen

virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) = 0

Detaillierte Beschreibung

Siehe Image Response Provider Example für eine vollständige Implementierung.

Siehe auch QQuickImageProvider.

Dokumentation der Mitgliedsfunktionen

[pure virtual] QQuickImageResponse *QQuickAsyncImageProvider::requestImageResponse(const QString &id, const QSize &requestedSize)

Implementieren Sie diese Methode, um den Auftrag zurückzugeben, der die Textur mit id bereitstellt.

id ist die angeforderte Bildquelle, wobei das "image:"-Schema und die Anbieterkennung entfernt werden. Wenn das Bild source zum Beispiel "image://myprovider/icons/home" lautet, würde die angegebene id "icons/home" lauten.

Die requestedSize entspricht der Image::sourceSize, die von einem Image-Element angefordert wird. Wenn requestedSize eine gültige Größe ist, sollte das zurückgegebene Bild diese Größe haben.

Hinweis: Diese Methode kann von mehreren Threads aufgerufen werden, stellen Sie also sicher, dass die Implementierung dieser Methode reentrant ist.

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