Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQuickPixmap Class Reference

#include <qquickpixmapcache_p.h>

+ Inheritance diagram for QQuickPixmap:
+ Collaboration diagram for QQuickPixmap:

Public Types

enum  Status { Null , Ready , Error , Loading }
 
enum  Option { Asynchronous = 0x00000001 , Cache = 0x00000002 }
 

Public Member Functions

 QQuickPixmap ()
 
 QQuickPixmap (QQmlEngine *, const QUrl &)
 
 QQuickPixmap (QQmlEngine *, const QUrl &, const QRect &region, const QSize &)
 
 QQuickPixmap (const QUrl &, const QImage &image)
 
 ~QQuickPixmap ()
 
bool isNull () const
 
bool isReady () const
 
bool isError () const
 
bool isLoading () const
 
Status status () const
 
QString error () const
 
const QUrlurl () const
 
const QSizeimplicitSize () const
 
const QRectrequestRegion () const
 
const QSizerequestSize () const
 
QQuickImageProviderOptions::AutoTransform autoTransform () const
 
int frameCount () const
 
QImage image () const
 
void setImage (const QImage &)
 
void setPixmap (const QQuickPixmap &other)
 
QColorSpace colorSpace () const
 
QQuickTextureFactorytextureFactory () const
 
QRect rect () const
 
int width () const
 
int height () const
 
void load (QQmlEngine *, const QUrl &)
 
void load (QQmlEngine *, const QUrl &, QQuickPixmap::Options options)
 
void load (QQmlEngine *, const QUrl &, const QRect &requestRegion, const QSize &requestSize)
 
void load (QQmlEngine *, const QUrl &, const QRect &requestRegion, const QSize &requestSize, QQuickPixmap::Options options)
 
void load (QQmlEngine *, const QUrl &, const QRect &requestRegion, const QSize &requestSize, QQuickPixmap::Options options, const QQuickImageProviderOptions &providerOptions, int frame=0, int frameCount=1, qreal devicePixelRatio=1.0)
 
void loadImageFromDevice (QQmlEngine *engine, QIODevice *device, const QUrl &url, const QRect &requestRegion, const QSize &requestSize, const QQuickImageProviderOptions &providerOptions, int frame=0, int frameCount=1)
 
void clear ()
 
void clear (QObject *)
 
bool connectFinished (QObject *, const char *)
 
bool connectFinished (QObject *, int)
 
bool connectDownloadProgress (QObject *, const char *)
 
bool connectDownloadProgress (QObject *, int)
 

Static Public Member Functions

static void purgeCache ()
 
static bool isCached (const QUrl &url, const QRect &requestRegion, const QSize &requestSize, const int frame, const QQuickImageProviderOptions &options)
 

Static Public Attributes

static const QLatin1String itemGrabberScheme = QLatin1String("itemgrabber")
 

Friends

class QQuickPixmapData
 

Detailed Description

Definition at line 91 of file qquickpixmapcache_p.h.

Member Enumeration Documentation

◆ Option

Enumerator
Asynchronous 
Cache 

Definition at line 103 of file qquickpixmapcache_p.h.

◆ Status

Enumerator
Null 
Ready 
Error 
Loading 

Definition at line 101 of file qquickpixmapcache_p.h.

Constructor & Destructor Documentation

◆ QQuickPixmap() [1/4]

QQuickPixmap::QQuickPixmap ( )

Definition at line 1576 of file qquickpixmapcache.cpp.

◆ QQuickPixmap() [2/4]

QQuickPixmap::QQuickPixmap ( QQmlEngine engine,
const QUrl url 
)

Definition at line 1581 of file qquickpixmapcache.cpp.

References engine, load(), and url().

+ Here is the call graph for this function:

◆ QQuickPixmap() [3/4]

QQuickPixmap::QQuickPixmap ( QQmlEngine engine,
const QUrl url,
const QRect region,
const QSize size 
)

Definition at line 1587 of file qquickpixmapcache.cpp.

References engine, load(), and url().

+ Here is the call graph for this function:

◆ QQuickPixmap() [4/4]

QQuickPixmap::QQuickPixmap ( const QUrl url,
const QImage image 
)

Definition at line 1593 of file qquickpixmapcache.cpp.

References QQuickPixmapData::addToCache(), QQuickPixmapData, url(), and QQuickImageProviderOptions::UsePluginDefaultTransform.

+ Here is the call graph for this function:

◆ ~QQuickPixmap()

QQuickPixmap::~QQuickPixmap ( )

Definition at line 1600 of file qquickpixmapcache.cpp.

References QQuickPixmapData::declarativePixmaps, QQuickPixmapData::release(), and QIntrusiveList< N, member >::remove().

Referenced by load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ autoTransform()

◆ clear() [1/2]

void QQuickPixmap::clear ( )

Definition at line 1900 of file qquickpixmapcache.cpp.

References QQuickPixmapData::declarativePixmaps, QQuickPixmapData::release(), and QIntrusiveList< N, member >::remove().

Referenced by setImage(), and setPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear() [2/2]

void QQuickPixmap::clear ( QObject obj)

Definition at line 1909 of file qquickpixmapcache.cpp.

References QQuickPixmapData::declarativePixmaps, QObject::disconnect(), QQuickPixmapData::release(), QIntrusiveList< N, member >::remove(), and QQuickPixmapData::reply.

+ Here is the call graph for this function:

◆ colorSpace()

QColorSpace QQuickPixmap::colorSpace ( ) const

Definition at line 1971 of file qquickpixmapcache.cpp.

References QImage::colorSpace(), QQuickTextureFactory::image(), and QQuickPixmapData::textureFactory.

+ Here is the call graph for this function:

◆ connectDownloadProgress() [1/2]

bool QQuickPixmap::connectDownloadProgress ( QObject object,
const char *  method 
)

Definition at line 1949 of file qquickpixmapcache.cpp.

References QObject::connect(), method, qWarning, QQuickPixmapData::reply, and SIGNAL.

+ Here is the call graph for this function:

◆ connectDownloadProgress() [2/2]

bool QQuickPixmap::connectDownloadProgress ( QObject object,
int  method 
)

Definition at line 1960 of file qquickpixmapcache.cpp.

References QMetaObject::connect(), QQuickPixmapReply::downloadProgressMethodIndex, method, qWarning, and QQuickPixmapData::reply.

+ Here is the call graph for this function:

◆ connectFinished() [1/2]

bool QQuickPixmap::connectFinished ( QObject object,
const char *  method 
)

Definition at line 1929 of file qquickpixmapcache.cpp.

References QObject::connect(), method, qWarning, QQuickPixmapData::reply, and SIGNAL.

+ Here is the call graph for this function:

◆ connectFinished() [2/2]

bool QQuickPixmap::connectFinished ( QObject object,
int  method 
)

Definition at line 1939 of file qquickpixmapcache.cpp.

References QMetaObject::connect(), QQuickPixmapReply::finishedMethodIndex, method, qWarning, and QQuickPixmapData::reply.

+ Here is the call graph for this function:

◆ error()

QString QQuickPixmap::error ( ) const

Definition at line 1629 of file qquickpixmapcache.cpp.

References QQuickPixmapData::errorString.

◆ frameCount()

int QQuickPixmap::frameCount ( ) const

Definition at line 1685 of file qquickpixmapcache.cpp.

References QQuickPixmapData::frameCount.

Referenced by load(), and loadImageFromDevice().

+ Here is the caller graph for this function:

◆ height()

int QQuickPixmap::height ( ) const

Definition at line 1734 of file qquickpixmapcache.cpp.

References QSize::height(), QQuickPixmapData::textureFactory, and QQuickTextureFactory::textureSize().

Referenced by QQuickCanvasPixmap::height(), load(), and QQuickIconImagePrivate::updateFillMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ image()

QImage QQuickPixmap::image ( ) const

Definition at line 1700 of file qquickpixmapcache.cpp.

References QQuickTextureFactory::image(), and QQuickPixmapData::textureFactory.

Referenced by QQuickCanvasPixmap::image(), QQuickDragAttachedPrivate::startDrag(), and QQuickLabsPlatformIconLoader::toQIcon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ implicitSize()

const QSize & QQuickPixmap::implicitSize ( ) const

Definition at line 1653 of file qquickpixmapcache.cpp.

References QQuickPixmapData::implicitSize.

◆ isCached()

bool QQuickPixmap::isCached ( const QUrl url,
const QRect requestRegion,
const QSize requestSize,
const int  frame,
const QQuickImageProviderOptions options 
)
static

Definition at line 1920 of file qquickpixmapcache.cpp.

References QHash< Key, T >::contains(), frame, QQuickPixmapStore::m_cache, requestRegion(), requestSize(), and url().

Referenced by QQuickAnimatedImagePrivate::infoForCurrentFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isError()

bool QQuickPixmap::isError ( ) const

Definition at line 1619 of file qquickpixmapcache.cpp.

References Error, and status().

+ Here is the call graph for this function:

◆ isLoading()

bool QQuickPixmap::isLoading ( ) const

Definition at line 1624 of file qquickpixmapcache.cpp.

References Loading, and status().

+ Here is the call graph for this function:

◆ isNull()

bool QQuickPixmap::isNull ( ) const

Definition at line 1609 of file qquickpixmapcache.cpp.

◆ isReady()

bool QQuickPixmap::isReady ( ) const

Definition at line 1614 of file qquickpixmapcache.cpp.

References Ready, and status().

Referenced by QQuickCanvasPixmap::isValid(), and QQuickDragAttachedPrivate::startDrag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load() [1/5]

void QQuickPixmap::load ( QQmlEngine engine,
const QUrl url 
)

Definition at line 1750 of file qquickpixmapcache.cpp.

References Cache, engine, load(), and url().

Referenced by QQuickPixmap(), QQuickPixmap(), load(), load(), load(), and load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load() [2/5]

void QQuickPixmap::load ( QQmlEngine engine,
const QUrl url,
const QRect requestRegion,
const QSize requestSize 
)

Definition at line 1760 of file qquickpixmapcache.cpp.

References Cache, engine, load(), requestRegion(), requestSize(), and url().

+ Here is the call graph for this function:

◆ load() [3/5]

void QQuickPixmap::load ( QQmlEngine engine,
const QUrl url,
const QRect requestRegion,
const QSize requestSize,
QQuickPixmap::Options  options 
)

Definition at line 1765 of file qquickpixmapcache.cpp.

References engine, load(), requestRegion(), requestSize(), and url().

+ Here is the call graph for this function:

◆ load() [4/5]

void QQuickPixmap::load ( QQmlEngine engine,
const QUrl url,
const QRect requestRegion,
const QSize requestSize,
QQuickPixmap::Options  options,
const QQuickImageProviderOptions providerOptions,
int  frame = 0,
int  frameCount = 1,
qreal  devicePixelRatio = 1.0 
)

◆ load() [5/5]

void QQuickPixmap::load ( QQmlEngine engine,
const QUrl url,
QQuickPixmap::Options  options 
)

Definition at line 1755 of file qquickpixmapcache.cpp.

References engine, load(), and url().

+ Here is the call graph for this function:

◆ loadImageFromDevice()

void QQuickPixmap::loadImageFromDevice ( QQmlEngine engine,
QIODevice device,
const QUrl url,
const QRect requestRegion,
const QSize requestSize,
const QQuickImageProviderOptions providerOptions,
int  frame = 0,
int  frameCount = 1 
)

Attempts to load an image from the given url via the given device. This is for special cases when the QImageIOHandler can benefit from reusing the I/O device, or from something extra that a subclass of QIODevice carries with it. So far, this code doesn't support loading anything other than a QImage, for example compressed textures. It can be added if needed.

Definition at line 1867 of file qquickpixmapcache.cpp.

References QQuickPixmapData::addref(), QQuickPixmapData::addToCache(), QObject::connect(), QQuickPixmapData::declarativePixmaps, device, QHash< Key, T >::end(), engine, QHash< Key, T >::find(), QQuickPixmapReply::finished(), frame, frameCount(), QQuickPixmapReader::getImage(), QIntrusiveList< N, member >::insert(), QQuickPixmapReader::instance(), iter, QMutex::lock(), QQuickPixmapStore::m_cache, QQuickPixmapData, QQuickPixmapReader::readerMutex, QQuickPixmapData::reply, requestRegion(), requestSize(), QQuickPixmapData::specialDevice, QMutex::unlock(), url(), and QQuickImageProviderOptions::UsePluginDefaultTransform.

+ Here is the call graph for this function:

◆ purgeCache()

void QQuickPixmap::purgeCache ( )
static

Definition at line 1330 of file qquickpixmapcache.cpp.

Referenced by QQuickWindow::~QQuickWindow(), QQmlPreviewHandler::loadUrl(), and QQuickWindow::releaseResources().

+ Here is the caller graph for this function:

◆ rect()

QRect QQuickPixmap::rect ( ) const

Definition at line 1742 of file qquickpixmapcache.cpp.

References QQuickPixmapData::textureFactory, and QQuickTextureFactory::textureSize().

+ Here is the call graph for this function:

◆ requestRegion()

const QRect & QQuickPixmap::requestRegion ( ) const

Definition at line 1669 of file qquickpixmapcache.cpp.

References QQuickPixmapData::requestRegion.

Referenced by isCached(), load(), load(), load(), and loadImageFromDevice().

+ Here is the caller graph for this function:

◆ requestSize()

const QSize & QQuickPixmap::requestSize ( ) const

Definition at line 1661 of file qquickpixmapcache.cpp.

References QQuickPixmapData::requestSize.

Referenced by isCached(), load(), load(), load(), and loadImageFromDevice().

+ Here is the caller graph for this function:

◆ setImage()

void QQuickPixmap::setImage ( const QImage p)

Definition at line 1707 of file qquickpixmapcache.cpp.

References clear(), QQuickPixmapData, and QQuickTextureFactory::textureFactoryForImage().

Referenced by QQuickImagePrivate::setImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPixmap()

void QQuickPixmap::setPixmap ( const QQuickPixmap other)

Definition at line 1715 of file qquickpixmapcache.cpp.

References QQuickPixmapData::addref(), clear(), QQuickPixmapData::declarativePixmaps, QIntrusiveList< N, member >::insert(), and other().

Referenced by QQuickImagePrivate::setPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ status()

QQuickPixmap::Status QQuickPixmap::status ( ) const

Definition at line 1637 of file qquickpixmapcache.cpp.

References Null, and QQuickPixmapData::pixmapStatus.

Referenced by isError(), isLoading(), and isReady().

+ Here is the caller graph for this function:

◆ textureFactory()

QQuickTextureFactory * QQuickPixmap::textureFactory ( ) const

Definition at line 1692 of file qquickpixmapcache.cpp.

References QQuickPixmapData::textureFactory.

◆ url()

const QUrl & QQuickPixmap::url ( ) const

Definition at line 1645 of file qquickpixmapcache.cpp.

References QUrl::url(), and QQuickPixmapData::url.

Referenced by QQuickPixmap(), QQuickPixmap(), QQuickPixmap(), isCached(), load(), load(), load(), load(), load(), and loadImageFromDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ width()

int QQuickPixmap::width ( ) const

Definition at line 1726 of file qquickpixmapcache.cpp.

References QQuickPixmapData::textureFactory, QQuickTextureFactory::textureSize(), and QSize::width().

Referenced by load(), QQuickIconImagePrivate::updateFillMode(), and QQuickCanvasPixmap::width().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QQuickPixmapData

friend class QQuickPixmapData
friend

Definition at line 163 of file qquickpixmapcache_p.h.

Referenced by QQuickPixmap(), load(), loadImageFromDevice(), and setImage().

Member Data Documentation

◆ itemGrabberScheme

const QLatin1String QQuickPixmap::itemGrabberScheme = QLatin1String("itemgrabber")
static

Definition at line 157 of file qquickpixmapcache_p.h.

Referenced by QQuickItemGrabResultPrivate::ensureImageInCache(), and load().


The documentation for this class was generated from the following files: