PySide6.QtQml.QQmlImageProviderBase

class QQmlImageProviderBase

QQmlImageProviderBase 类用于在 QML 引擎中注册图像提供者。更多

PySide6.QtQml.QQmlImageProviderBase 的继承图

继承者: QQuickImageProvider, QQuickAsyncImageProvider

概要

虚拟方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

图像提供者必须在QML引擎中注册。QML引擎对图像提供者唯一了解的信息是它们提供的图像数据类型。要使用图像提供者获取图像数据,您必须将QQmlImageProviderBase指针转换为QQuickImageProvider指针。

另请参阅

QQuickImageProviderQQuickTextureFactory

class ImageType

定义此图像提供程序支持的图像类型。

常量

描述

QQmlImageProviderBase.Image

图像提供者提供QImage图像。所有图像请求都将调用QQuickImageProvider::requestImage()方法。

QQmlImageProviderBase.Pixmap

图像提供者提供QPixmap图像。对于所有图像请求,将调用QQuickImageProvider::requestPixmap()方法。

QQmlImageProviderBase.Texture

图像提供者提供基于QSGTextureProvider的图像。所有图像请求都将调用QQuickImageProvider::requestTexture()方法。

QQmlImageProviderBase.ImageResponse

图像提供者提供基于QQuickTextureFactory的图像。应仅在QQuickAsyncImageProvider或其子类中使用。对于所有图像请求,将调用QQuickAsyncImageProvider::requestImageResponse()方法。自Qt 5.6起

class Flag

(继承 enum.Flag) 定义此图像提供程序的特定要求或功能。

常量

描述

QQmlImageProviderBase.ForceAsynchronousImageLoading

确保对提供者的图像请求在一个单独的线程中运行,这使得提供者可以在不阻塞主线程的情况下花费尽可能多的时间来生成图像。

abstract flags()
Return type:

Flag的组合

实现此功能以返回此图像提供程序的属性。

abstract imageType()
Return type:

ImageType

实现此方法以返回此图像提供者支持的图像类型。