The QQmlImageProviderBase class is used to register image providers in the QML engine. 更多...
头: | #include <QQmlImageProviderBase> |
qmake: | QT += qml |
enum | Flag { ForceAsynchronousImageLoading } |
flags | Flags |
enum | ImageType { Image, Pixmap, Texture, ImageResponse } |
virtual QQmlImageProviderBase::Flags | flags () const = 0 |
virtual QQmlImageProviderBase::ImageType | imageType () const = 0 |
The QQmlImageProviderBase class is used to register image providers in the QML engine.
Image providers must be registered with the QML engine. The only information the QML engine knows about image providers is the type of image data they provide. To use an image provider to acquire image data, you must cast the QQmlImageProviderBase pointer to a QQuickImageProvider 指针。
另请参阅 QQuickImageProvider and QQuickTextureFactory .
Defines specific requirements or features of this image provider.
常量 | 值 | 描述 |
---|---|---|
QQmlImageProviderBase::ForceAsynchronousImageLoading
|
0x01
|
Ensures that image requests to the provider are run in a separate thread, which allows the provider to spend as much time as needed on producing the image without blocking the main thread. |
Flags 类型是 typedef 对于 QFlags <Flag>。它存储 Flag 值的 OR 组合。
Defines the type of image supported by this image provider.
常量 | 值 | 描述 |
---|---|---|
QQmlImageProviderBase::Image
|
0
|
The Image Provider provides QImage images. The QQuickImageProvider::requestImage () method will be called for all image requests. |
QQmlImageProviderBase::Pixmap
|
1
|
The Image Provider provides QPixmap images. The QQuickImageProvider::requestPixmap () method will be called for all image requests. |
QQmlImageProviderBase::Texture
|
2
|
The Image Provider provides QSGTextureProvider based images. The QQuickImageProvider::requestTexture () method will be called for all image requests. |
QQmlImageProviderBase::ImageResponse
|
4
|
The Image provider provides QQuickTextureFactory based images. Should only be used in QQuickAsyncImageProvider or its subclasses. The QQuickAsyncImageProvider::requestImageResponse () method will be called for all image requests. Since Qt 5.6 |
[pure virtual]
QQmlImageProviderBase::Flags
QQmlImageProviderBase::
flags
() const
Implement this to return the properties of this image provider.
[pure virtual]
QQmlImageProviderBase::ImageType
QQmlImageProviderBase::
imageType
() const
Implement this method to return the image type supported by this image provider.