Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qquickpixmap_p.h>
Public Types | |
enum | Status { Null , Ready , Error , Loading } |
enum | Option { Asynchronous = 0x00000001 , Cache = 0x00000002 } |
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 |
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 103 of file qquickpixmap_p.h.
enum QQuickPixmap::Option |
Enumerator | |
---|---|
Asynchronous | |
Cache |
Definition at line 109 of file qquickpixmap_p.h.
enum QQuickPixmap::Status |
Enumerator | |
---|---|
Null | |
Ready | |
Error | |
Loading |
Definition at line 107 of file qquickpixmap_p.h.
QQuickPixmap::QQuickPixmap | ( | ) |
Definition at line 1641 of file qquickpixmapcache.cpp.
QQuickPixmap::QQuickPixmap | ( | QQmlEngine * | engine, |
const QUrl & | url ) |
Definition at line 1646 of file qquickpixmapcache.cpp.
References engine, load(), and url().
QQuickPixmap::QQuickPixmap | ( | QQmlEngine * | engine, |
const QUrl & | url, | ||
Options | options ) |
Definition at line 1652 of file qquickpixmapcache.cpp.
References engine, load(), and url().
QQuickPixmap::QQuickPixmap | ( | QQmlEngine * | engine, |
const QUrl & | url, | ||
const QRect & | region, | ||
const QSize & | size ) |
Definition at line 1658 of file qquickpixmapcache.cpp.
References engine, load(), and url().
Definition at line 1664 of file qquickpixmapcache.cpp.
References QQuickPixmapData::addToCache(), QQuickPixmapData, url(), and QQuickImageProviderOptions::UsePluginDefaultTransform.
QQuickPixmap::~QQuickPixmap | ( | ) |
Definition at line 1671 of file qquickpixmapcache.cpp.
References QQuickPixmapData::release().
Referenced by load().
QQuickImageProviderOptions::AutoTransform QQuickPixmap::autoTransform | ( | ) | const |
Definition at line 1747 of file qquickpixmapcache.cpp.
References QQuickPixmapData::appliedTransform, and QQuickImageProviderOptions::UsePluginDefaultTransform.
void QQuickPixmap::clear | ( | ) |
Definition at line 1986 of file qquickpixmapcache.cpp.
References QQuickPixmapData::release().
Referenced by setImage(), and setPixmap().
Definition at line 1994 of file qquickpixmapcache.cpp.
References QObject::disconnect(), QQuickPixmapData::release(), and QQuickPixmapData::reply.
QColorSpace QQuickPixmap::colorSpace | ( | ) | const |
Definition at line 2066 of file qquickpixmapcache.cpp.
References QQuickTextureFactory::image(), and QQuickPixmapData::textureFactory.
bool QQuickPixmap::connectDownloadProgress | ( | QObject * | object, |
const char * | method ) |
Definition at line 2044 of file qquickpixmapcache.cpp.
References QObject::connect(), method, qWarning, QQuickPixmapData::reply, and SIGNAL.
bool QQuickPixmap::connectDownloadProgress | ( | QObject * | object, |
int | method ) |
Definition at line 2055 of file qquickpixmapcache.cpp.
References QMetaObject::connect(), QQuickPixmapReply::downloadProgressMethodIndex, method, qWarning, and QQuickPixmapData::reply.
bool QQuickPixmap::connectFinished | ( | QObject * | object, |
const char * | method ) |
Definition at line 2024 of file qquickpixmapcache.cpp.
References QObject::connect(), method, qWarning, QQuickPixmapData::reply, and SIGNAL.
bool QQuickPixmap::connectFinished | ( | QObject * | object, |
int | method ) |
Definition at line 2034 of file qquickpixmapcache.cpp.
References QMetaObject::connect(), QQuickPixmapReply::finishedMethodIndex, method, qWarning, and QQuickPixmapData::reply.
QString QQuickPixmap::error | ( | ) | const |
Definition at line 1699 of file qquickpixmapcache.cpp.
References QQuickPixmapData::errorString.
int QQuickPixmap::frameCount | ( | ) | const |
Definition at line 1755 of file qquickpixmapcache.cpp.
References QQuickPixmapData::frameCount.
Referenced by load(), and loadImageFromDevice().
int QQuickPixmap::height | ( | ) | const |
Definition at line 1810 of file qquickpixmapcache.cpp.
References QQuickPixmapData::textureFactory, and QQuickTextureFactory::textureSize().
Referenced by QQuickCanvasPixmap::height(), load(), and QQuickIconImagePrivate::updateFillMode().
QImage QQuickPixmap::image | ( | ) | const |
Definition at line 1770 of file qquickpixmapcache.cpp.
References QQuickTextureFactory::image(), and QQuickPixmapData::textureFactory.
Referenced by QQuickCanvasPixmap::image(), QQuickDragAttachedPrivate::startDrag(), and QQuickLabsPlatformIconLoader::toQIcon().
const QSize & QQuickPixmap::implicitSize | ( | ) | const |
Definition at line 1723 of file qquickpixmapcache.cpp.
References QQuickPixmapData::implicitSize.
|
static |
Definition at line 2004 of file qquickpixmapcache.cpp.
References QHash< Key, T >::contains(), frame, QQuickPixmapCache::instance(), requestRegion(), requestSize(), and url().
Referenced by QQuickAnimatedImagePrivate::infoForCurrentFrame().
bool QQuickPixmap::isError | ( | ) | const |
Definition at line 1689 of file qquickpixmapcache.cpp.
References Error, and status().
bool QQuickPixmap::isLoading | ( | ) | const |
Definition at line 1694 of file qquickpixmapcache.cpp.
References Loading, and status().
bool QQuickPixmap::isNull | ( | ) | const |
Definition at line 1679 of file qquickpixmapcache.cpp.
bool QQuickPixmap::isReady | ( | ) | const |
Definition at line 1684 of file qquickpixmapcache.cpp.
References Ready, and status().
Referenced by QQuickCanvasPixmap::isValid(), and QQuickDragAttachedPrivate::startDrag().
|
static |
Definition at line 2013 of file qquickpixmapcache.cpp.
References QString::endsWith(), QUrl::path(), QUrl::PrettyDecoded, QUrl::scheme(), and url().
Referenced by QQuickText::itemChange(), QQuickImageBase::loadPixmap(), and QQuickImageBasePrivate::updateDevicePixelRatio().
void QQuickPixmap::load | ( | QQmlEngine * | engine, |
const QUrl & | url ) |
Definition at line 1826 of file qquickpixmapcache.cpp.
References Cache, engine, load(), and url().
Referenced by QQuickPixmap(), QQuickPixmap(), QQuickPixmap(), load(), load(), load(), load(), and QQuickDragAttachedPrivate::loadPixmap().
void QQuickPixmap::load | ( | QQmlEngine * | engine, |
const QUrl & | url, | ||
const QRect & | requestRegion, | ||
const QSize & | requestSize ) |
Definition at line 1836 of file qquickpixmapcache.cpp.
References Cache, engine, load(), requestRegion(), requestSize(), and url().
void QQuickPixmap::load | ( | QQmlEngine * | engine, |
const QUrl & | url, | ||
const QRect & | requestRegion, | ||
const QSize & | requestSize, | ||
QQuickPixmap::Options | options ) |
Definition at line 1841 of file qquickpixmapcache.cpp.
References engine, load(), requestRegion(), requestSize(), and url().
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 1846 of file qquickpixmapcache.cpp.
References ~QQuickPixmap(), QQuickPixmapData::addref(), QQuickPixmapData::addToCache(), Asynchronous, Cache, createPixmapDataSync(), QHash< Key, T >::end(), engine, QHash< Key, T >::find(), QQmlImageProviderBase::ForceAsynchronousImageLoading, frame, frameCount(), QQmlEnginePrivate::get(), height(), QQmlEnginePrivate::imageProvider(), imageProviderId(), QQuickPixmapCache::instance(), QQuickPixmapReader::instance(), itemGrabberScheme, iter, ok, QQmlImageProviderBase::Pixmap, PIXMAP_PROFILE, QGuiApplicationPrivate::platformIntegration(), qCDebug, QQuickPixmapData, qWarning, QQuickPixmapReader::readerMutex, QQuickPixmapData::release(), QQuickPixmapData::reply, requestRegion(), requestSize(), QUrl::scheme(), QPlatformIntegration::ThreadedPixmaps, QMutexLocker< Mutex >::unlock(), url(), QQuickImageProviderOptions::UsePluginDefaultTransform, and width().
void QQuickPixmap::load | ( | QQmlEngine * | engine, |
const QUrl & | url, | ||
QQuickPixmap::Options | options ) |
Definition at line 1831 of file qquickpixmapcache.cpp.
References engine, load(), and url().
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 1946 of file qquickpixmapcache.cpp.
References QQuickPixmapData::addref(), QQuickPixmapData::addToCache(), QObject::connect(), QObject::destroyed(), device, QHash< Key, T >::end(), engine, QHash< Key, T >::find(), frame, frameCount(), QQuickPixmapCache::instance(), QQuickPixmapReader::instance(), iter, qCDebug, QQuickPixmapData, Qt::QueuedConnection, QQuickPixmapReader::readerMutex, QQuickPixmapData::refCount, QQuickPixmapData::reply, requestRegion(), requestSize(), QQuickPixmapData::specialDevice, QMutexLocker< Mutex >::unlock(), url(), and QQuickImageProviderOptions::UsePluginDefaultTransform.
|
static |
Definition at line 1375 of file qquickpixmapcache.cpp.
References QQuickPixmapCache::instance().
Referenced by QQuickWindow::~QQuickWindow(), QQmlPreviewHandler::loadUrl(), and QQuickWindow::releaseResources().
QRect QQuickPixmap::rect | ( | ) | const |
Definition at line 1818 of file qquickpixmapcache.cpp.
References QQuickPixmapData::textureFactory, and QQuickTextureFactory::textureSize().
const QRect & QQuickPixmap::requestRegion | ( | ) | const |
Definition at line 1739 of file qquickpixmapcache.cpp.
References QQuickPixmapData::requestRegion.
Referenced by isCached(), load(), load(), load(), and loadImageFromDevice().
const QSize & QQuickPixmap::requestSize | ( | ) | const |
Definition at line 1731 of file qquickpixmapcache.cpp.
References QQuickPixmapData::requestSize.
Referenced by isCached(), load(), load(), load(), and loadImageFromDevice().
Definition at line 1777 of file qquickpixmapcache.cpp.
References clear(), QQuickPixmapData, QQuickPixmapData::release(), and QQuickTextureFactory::textureFactoryForImage().
Referenced by QQuickItemGenerator::generateImageNode(), QQuickAnimatedImagePrivate::infoForCurrentFrame(), and QQuickImagePrivate::setImage().
void QQuickPixmap::setPixmap | ( | const QQuickPixmap & | other | ) |
Definition at line 1788 of file qquickpixmapcache.cpp.
References QQuickPixmapData::addref(), clear(), other(), and QQuickPixmapData::release().
Referenced by QQuickImagePrivate::setPixmap().
QQuickPixmap::Status QQuickPixmap::status | ( | ) | const |
Definition at line 1707 of file qquickpixmapcache.cpp.
References Null, and QQuickPixmapData::pixmapStatus.
Referenced by isError(), isLoading(), and isReady().
QQuickTextureFactory * QQuickPixmap::textureFactory | ( | ) | const |
Definition at line 1762 of file qquickpixmapcache.cpp.
References QQuickPixmapData::textureFactory.
const QUrl & QQuickPixmap::url | ( | ) | const |
Definition at line 1715 of file qquickpixmapcache.cpp.
References QUrl::url(), and QQuickPixmapData::url.
Referenced by QQuickPixmap(), QQuickPixmap(), QQuickPixmap(), QQuickPixmap(), isCached(), isScalableImageFormat(), load(), load(), load(), load(), load(), and loadImageFromDevice().
int QQuickPixmap::width | ( | ) | const |
Definition at line 1802 of file qquickpixmapcache.cpp.
References QQuickPixmapData::textureFactory, and QQuickTextureFactory::textureSize().
Referenced by load(), QQuickIconImagePrivate::updateFillMode(), and QQuickCanvasPixmap::width().
|
friend |
Definition at line 176 of file qquickpixmap_p.h.
Referenced by QQuickPixmap(), load(), loadImageFromDevice(), and setImage().
|
static |
Definition at line 171 of file qquickpixmap_p.h.
Referenced by QQuickItemGrabResultPrivate::ensureImageInCache(), and load().