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 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 1639 of file qquickpixmapcache.cpp.
QQuickPixmap::QQuickPixmap | ( | QQmlEngine * | engine, |
const QUrl & | url ) |
Definition at line 1644 of file qquickpixmapcache.cpp.
References engine, load(), and url().
QQuickPixmap::QQuickPixmap | ( | QQmlEngine * | engine, |
const QUrl & | url, | ||
Options | options ) |
Definition at line 1650 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 1656 of file qquickpixmapcache.cpp.
References engine, load(), and url().
Definition at line 1662 of file qquickpixmapcache.cpp.
References QQuickPixmapData::addToCache(), QQuickPixmapData, url(), and QQuickImageProviderOptions::UsePluginDefaultTransform.
QQuickPixmap::~QQuickPixmap | ( | ) |
Definition at line 1669 of file qquickpixmapcache.cpp.
References QQuickPixmapData::release().
Referenced by load().
QQuickImageProviderOptions::AutoTransform QQuickPixmap::autoTransform | ( | ) | const |
Definition at line 1745 of file qquickpixmapcache.cpp.
References QQuickPixmapData::appliedTransform, and QQuickImageProviderOptions::UsePluginDefaultTransform.
void QQuickPixmap::clear | ( | ) |
Definition at line 1984 of file qquickpixmapcache.cpp.
References QQuickPixmapData::release().
Referenced by setImage(), and setPixmap().
Definition at line 1992 of file qquickpixmapcache.cpp.
References QObject::disconnect(), QQuickPixmapData::release(), and QQuickPixmapData::reply.
QColorSpace QQuickPixmap::colorSpace | ( | ) | const |
Definition at line 2053 of file qquickpixmapcache.cpp.
References QQuickTextureFactory::image(), and QQuickPixmapData::textureFactory.
bool QQuickPixmap::connectDownloadProgress | ( | QObject * | object, |
const char * | method ) |
Definition at line 2031 of file qquickpixmapcache.cpp.
References QObject::connect(), method, qWarning, QQuickPixmapData::reply, and SIGNAL.
bool QQuickPixmap::connectDownloadProgress | ( | QObject * | object, |
int | method ) |
Definition at line 2042 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 2011 of file qquickpixmapcache.cpp.
References QObject::connect(), method, qWarning, QQuickPixmapData::reply, and SIGNAL.
bool QQuickPixmap::connectFinished | ( | QObject * | object, |
int | method ) |
Definition at line 2021 of file qquickpixmapcache.cpp.
References QMetaObject::connect(), QQuickPixmapReply::finishedMethodIndex, method, qWarning, and QQuickPixmapData::reply.
QString QQuickPixmap::error | ( | ) | const |
Definition at line 1697 of file qquickpixmapcache.cpp.
References QQuickPixmapData::errorString.
int QQuickPixmap::frameCount | ( | ) | const |
Definition at line 1753 of file qquickpixmapcache.cpp.
References QQuickPixmapData::frameCount.
Referenced by load(), and loadImageFromDevice().
int QQuickPixmap::height | ( | ) | const |
Definition at line 1808 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 1768 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 1721 of file qquickpixmapcache.cpp.
References QQuickPixmapData::implicitSize.
|
static |
Definition at line 2002 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 1687 of file qquickpixmapcache.cpp.
References Error, and status().
bool QQuickPixmap::isLoading | ( | ) | const |
Definition at line 1692 of file qquickpixmapcache.cpp.
References Loading, and status().
bool QQuickPixmap::isNull | ( | ) | const |
Definition at line 1677 of file qquickpixmapcache.cpp.
bool QQuickPixmap::isReady | ( | ) | const |
Definition at line 1682 of file qquickpixmapcache.cpp.
References Ready, and status().
Referenced by QQuickCanvasPixmap::isValid(), and QQuickDragAttachedPrivate::startDrag().
void QQuickPixmap::load | ( | QQmlEngine * | engine, |
const QUrl & | url ) |
Definition at line 1824 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 1834 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 1839 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 1844 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 1829 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 1944 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 1373 of file qquickpixmapcache.cpp.
References QQuickPixmapCache::instance().
Referenced by QQuickWindow::~QQuickWindow(), QQmlPreviewHandler::loadUrl(), and QQuickWindow::releaseResources().
QRect QQuickPixmap::rect | ( | ) | const |
Definition at line 1816 of file qquickpixmapcache.cpp.
References QQuickPixmapData::textureFactory, and QQuickTextureFactory::textureSize().
const QRect & QQuickPixmap::requestRegion | ( | ) | const |
Definition at line 1737 of file qquickpixmapcache.cpp.
References QQuickPixmapData::requestRegion.
Referenced by isCached(), load(), load(), load(), and loadImageFromDevice().
const QSize & QQuickPixmap::requestSize | ( | ) | const |
Definition at line 1729 of file qquickpixmapcache.cpp.
References QQuickPixmapData::requestSize.
Referenced by isCached(), load(), load(), load(), and loadImageFromDevice().
Definition at line 1775 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 1786 of file qquickpixmapcache.cpp.
References QQuickPixmapData::addref(), clear(), other(), and QQuickPixmapData::release().
Referenced by QQuickImagePrivate::setPixmap().
QQuickPixmap::Status QQuickPixmap::status | ( | ) | const |
Definition at line 1705 of file qquickpixmapcache.cpp.
References Null, and QQuickPixmapData::pixmapStatus.
Referenced by isError(), isLoading(), and isReady().
QQuickTextureFactory * QQuickPixmap::textureFactory | ( | ) | const |
Definition at line 1760 of file qquickpixmapcache.cpp.
References QQuickPixmapData::textureFactory.
const QUrl & QQuickPixmap::url | ( | ) | const |
Definition at line 1713 of file qquickpixmapcache.cpp.
References QUrl::url(), and QQuickPixmapData::url.
Referenced by QQuickPixmap(), QQuickPixmap(), QQuickPixmap(), QQuickPixmap(), isCached(), load(), load(), load(), load(), load(), and loadImageFromDevice().
int QQuickPixmap::width | ( | ) | const |
Definition at line 1800 of file qquickpixmapcache.cpp.
References QQuickPixmapData::textureFactory, and QQuickTextureFactory::textureSize().
Referenced by load(), QQuickIconImagePrivate::updateFillMode(), and QQuickCanvasPixmap::width().
|
friend |
Definition at line 175 of file qquickpixmap_p.h.
Referenced by QQuickPixmap(), load(), loadImageFromDevice(), and setImage().
|
static |
Definition at line 170 of file qquickpixmap_p.h.
Referenced by QQuickItemGrabResultPrivate::ensureImageInCache(), and load().