In questa pagina

QQmlImageProviderBase Class

La classe QQmlImageProviderBase viene utilizzata per registrare i provider di immagini nel motore QML. Per saperne di più...

Intestazione: #include <QQmlImageProviderBase>
CMake: find_package(Qt6 REQUIRED COMPONENTS Qml)
target_link_libraries(mytarget PRIVATE Qt6::Qml)
qmake: QT += qml
Eredita da: QObject
Ereditato da:

QQuickImageProvider

Tipi pubblici

enum Flag { ForceAsynchronousImageLoading }
flags Flags
enum ImageType { Image, Pixmap, Texture, ImageResponse }

Funzioni pubbliche

virtual QQmlImageProviderBase::Flags flags() const = 0
virtual QQmlImageProviderBase::ImageType imageType() const = 0

Descrizione dettagliata

I provider di immagini devono essere registrati nel motore QML. L'unica informazione che il motore QML conosce sui provider di immagini è il tipo di dati immagine che forniscono. Per utilizzare un provider di immagini per acquisire dati immagine, è necessario convertire il puntatore QQmlImageProviderBase in un puntatore QQuickImageProvider.

Vedi anche QQuickImageProvider e QQuickTextureFactory.

Documentazione sui tipi membro

enum QQmlImageProviderBase::Flag
flags QQmlImageProviderBase::Flags

Definisce i requisiti o le caratteristiche specifiche di questo fornitore di immagini.

CostanteValoreDescrizione
QQmlImageProviderBase::ForceAsynchronousImageLoading0x01Assicura che le richieste di immagini al provider vengano eseguite in un thread separato, il che consente al provider di dedicare tutto il tempo necessario alla generazione dell'immagine senza bloccare il thread principale.

Il tipo Flags è un typedef per QFlags<Flag>. Memorizza una combinazione OR di valori Flag.

enum QQmlImageProviderBase::ImageType

Definisce il tipo di immagine supportato da questo provider di immagini.

CostanteValoreDescrizione
QQmlImageProviderBase::Image1Il provider di immagini fornisce immagini QImage. Il metodo QQuickImageProvider::requestImage() verrà chiamato per tutte le richieste di immagini.
QQmlImageProviderBase::Pixmap2Il provider di immagini fornisce immagini QPixmap. Il metodo QQuickImageProvider::requestPixmap() verrà chiamato per tutte le richieste di immagini.
QQmlImageProviderBase::Texture3Il provider di immagini fornisce immagini basate su QSGTextureProvider. Il metodo QQuickImageProvider::requestTexture() verrà chiamato per tutte le richieste di immagini.
QQmlImageProviderBase::ImageResponse4Il provider di immagini fornisce immagini basate su QQuickTextureFactory. Deve essere utilizzato esclusivamente in QQuickAsyncImageProvider o nelle sue sottoclassi. Il metodo QQuickAsyncImageProvider::requestImageResponse() verrà chiamato per tutte le richieste di immagini. A partire da Qt 5.6

Documentazione delle funzioni membro

[pure virtual] QQmlImageProviderBase::Flags QQmlImageProviderBase::flags() const

Implementa questo codice per restituire le proprietà di questo provider di immagini.

[pure virtual] QQmlImageProviderBase::ImageType QQmlImageProviderBase::imageType() const

Implementare questo metodo per restituire il tipo di immagine supportato da questo provider di immagini.

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