Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQuickPixmap Class Reference

#include <qquickpixmap_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 &, Options options)
 QQuickPixmap (QQmlEngine *, const QUrl &, const QRect &region, const QSize &)
 QQuickPixmap (const QUrl &, const QImage &imageimage)
 ~QQuickPixmap ()
bool isNull () const
bool isReady () const
bool isError () const
bool isLoading () const
Status status () const
QString error () const
const QUrl & url () const
const QSize & implicitSize () const
const QRect & requestRegion () const
const QSize & requestSize () const
QQuickImageProviderOptions::AutoTransform autoTransform () const
int frameCount () const
QImage image () const
void setImage (const QImage &)
void setPixmap (const QQuickPixmap &other)
QColorSpace colorSpace () const
QQuickTextureFactory * textureFactory () const
bool hasDroppedTransientImage () const
void removeDroppedTransientImageFromCache ()
QRect rect () const
int width () const
int height () const
qreal devicePixelRatio () 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 bool isScalableImageFormat (const QUrl &url)

Static Public Attributes

static const QLatin1String itemGrabberScheme = QLatin1String("itemgrabber")

Friends

class QQuickPixmapData

Detailed Description

A class that encapsulates the action of fetching a pixmap, as well as the pixmap itself (indirectly via QQuickPixmapData::textureFactory) and the responsibility of canceling outstanding requests. Rather than relying on QPixmapCache which doesn't cache all the information Qt Quick needs, QQuickPixmap implements its own cache, that correctly degrades over time. (QQuickPixmapData::release() marks it as being not-currently-used, and QQuickPixmapCache::shrinkCache() sweeps away the least-recently-released instances until the remaining bytes are less than cache_limit.)

Definition at line 108 of file qquickpixmap_p.h.

Member Enumeration Documentation

◆ Option

Enumerator
Asynchronous 
Cache 

Definition at line 114 of file qquickpixmap_p.h.

◆ Status

Enumerator
Null 
Ready 
Error 
Loading 

Definition at line 112 of file qquickpixmap_p.h.

Constructor & Destructor Documentation

◆ QQuickPixmap() [1/5]

QQuickPixmap::QQuickPixmap ( )

Definition at line 1733 of file qquickpixmapcache.cpp.

◆ QQuickPixmap() [2/5]

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

Definition at line 1738 of file qquickpixmapcache.cpp.

◆ QQuickPixmap() [3/5]

QQuickPixmap::QQuickPixmap ( QQmlEngine * engine,
const QUrl & url,
Options options )

Definition at line 1744 of file qquickpixmapcache.cpp.

◆ QQuickPixmap() [4/5]

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

Definition at line 1750 of file qquickpixmapcache.cpp.

◆ QQuickPixmap() [5/5]

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

Definition at line 1756 of file qquickpixmapcache.cpp.

◆ ~QQuickPixmap()

QQuickPixmap::~QQuickPixmap ( )

Definition at line 1764 of file qquickpixmapcache.cpp.

Member Function Documentation

◆ autoTransform()

QQuickImageProviderOptions::AutoTransform QQuickPixmap::autoTransform ( ) const

Definition at line 1840 of file qquickpixmapcache.cpp.

◆ clear() [1/2]

void QQuickPixmap::clear ( )

Definition at line 2099 of file qquickpixmapcache.cpp.

◆ clear() [2/2]

void QQuickPixmap::clear ( QObject * obj)

Definition at line 2107 of file qquickpixmapcache.cpp.

◆ colorSpace()

QColorSpace QQuickPixmap::colorSpace ( ) const

Definition at line 2209 of file qquickpixmapcache.cpp.

◆ connectDownloadProgress() [1/2]

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

Definition at line 2187 of file qquickpixmapcache.cpp.

◆ connectDownloadProgress() [2/2]

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

Definition at line 2198 of file qquickpixmapcache.cpp.

◆ connectFinished() [1/2]

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

Definition at line 2167 of file qquickpixmapcache.cpp.

◆ connectFinished() [2/2]

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

Definition at line 2177 of file qquickpixmapcache.cpp.

◆ devicePixelRatio()

qreal QQuickPixmap::devicePixelRatio ( ) const

Definition at line 1924 of file qquickpixmapcache.cpp.

◆ error()

QString QQuickPixmap::error ( ) const

Definition at line 1792 of file qquickpixmapcache.cpp.

◆ frameCount()

int QQuickPixmap::frameCount ( ) const

Definition at line 1848 of file qquickpixmapcache.cpp.

◆ hasDroppedTransientImage()

bool QQuickPixmap::hasDroppedTransientImage ( ) const

Definition at line 1863 of file qquickpixmapcache.cpp.

◆ height()

int QQuickPixmap::height ( ) const

Definition at line 1916 of file qquickpixmapcache.cpp.

◆ image()

QImage QQuickPixmap::image ( ) const

Definition at line 1876 of file qquickpixmapcache.cpp.

◆ implicitSize()

const QSize & QQuickPixmap::implicitSize ( ) const

Definition at line 1816 of file qquickpixmapcache.cpp.

◆ isCached()

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

Definition at line 2117 of file qquickpixmapcache.cpp.

◆ isError()

bool QQuickPixmap::isError ( ) const

Definition at line 1782 of file qquickpixmapcache.cpp.

◆ isLoading()

bool QQuickPixmap::isLoading ( ) const

Definition at line 1787 of file qquickpixmapcache.cpp.

◆ isNull()

bool QQuickPixmap::isNull ( ) const

Definition at line 1772 of file qquickpixmapcache.cpp.

◆ isReady()

bool QQuickPixmap::isReady ( ) const

Definition at line 1777 of file qquickpixmapcache.cpp.

◆ isScalableImageFormat()

bool QQuickPixmap::isScalableImageFormat ( const QUrl & url)
static

Definition at line 2126 of file qquickpixmapcache.cpp.

◆ load() [1/5]

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

Definition at line 1937 of file qquickpixmapcache.cpp.

◆ load() [2/5]

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

Definition at line 1947 of file qquickpixmapcache.cpp.

◆ load() [3/5]

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

Definition at line 1952 of file qquickpixmapcache.cpp.

◆ 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 )

Definition at line 1957 of file qquickpixmapcache.cpp.

◆ load() [5/5]

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

Definition at line 1942 of file qquickpixmapcache.cpp.

◆ 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 2058 of file qquickpixmapcache.cpp.

◆ purgeCache()

void QQuickPixmap::purgeCache ( )
static

Definition at line 1465 of file qquickpixmapcache.cpp.

◆ rect()

QRect QQuickPixmap::rect ( ) const

Definition at line 1929 of file qquickpixmapcache.cpp.

◆ removeDroppedTransientImageFromCache()

void QQuickPixmap::removeDroppedTransientImageFromCache ( )

Definition at line 1868 of file qquickpixmapcache.cpp.

◆ requestRegion()

const QRect & QQuickPixmap::requestRegion ( ) const

Definition at line 1832 of file qquickpixmapcache.cpp.

◆ requestSize()

const QSize & QQuickPixmap::requestSize ( ) const

Definition at line 1824 of file qquickpixmapcache.cpp.

◆ setImage()

void QQuickPixmap::setImage ( const QImage & p)

Definition at line 1883 of file qquickpixmapcache.cpp.

◆ setPixmap()

void QQuickPixmap::setPixmap ( const QQuickPixmap & other)

Definition at line 1894 of file qquickpixmapcache.cpp.

◆ status()

QQuickPixmap::Status QQuickPixmap::status ( ) const

Definition at line 1800 of file qquickpixmapcache.cpp.

◆ textureFactory()

QQuickTextureFactory * QQuickPixmap::textureFactory ( ) const

Definition at line 1855 of file qquickpixmapcache.cpp.

◆ url()

const QUrl & QQuickPixmap::url ( ) const

Definition at line 1808 of file qquickpixmapcache.cpp.

◆ width()

int QQuickPixmap::width ( ) const

Definition at line 1908 of file qquickpixmapcache.cpp.

◆ QQuickPixmapData

friend class QQuickPixmapData
friend

Definition at line 184 of file qquickpixmap_p.h.

Member Data Documentation

◆ itemGrabberScheme

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

Definition at line 179 of file qquickpixmap_p.h.


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