13#if defined(KGUIADDONS_LIB) && !defined(KCOREADDONS_LIB)
15#warning "KImageCache requires KF6CoreAddons (for kshareddatacache.h)"
17#pragma message("KImageCache requires KF6CoreAddons (for kshareddatacache.h)")
21#include <klocalimagecacheimpl.h>
22#include <kshareddatacache.h>
27#define KImageCache KSharedPixmapCacheMixin<KSharedDataCache>
74 : T(cacheName, defaultCacheSize, expectedItemSize)
94 insertLocalPixmap(key, pixmap);
116 if (this->insert(key, serializeImage(image))) {
117 updateModifiedTime();
133 if (findLocalPixmap(key, destination)) {
138 if (!this->find(key, &cachedData) || cachedData.
isNull()) {
146 insertLocalPixmap(key, *destination);
161 if (!this->find(key, &cachedData) || cachedData.
isNull()) {
185 using KLocalImageCacheImplementation::lastModifiedTime;
192 using KLocalImageCacheImplementation::pixmapCaching;
202 using KLocalImageCacheImplementation::setPixmapCaching;
208 using KLocalImageCacheImplementation::pixmapCacheLimit;
216 using KLocalImageCacheImplementation::setPixmapCacheLimit;
You are not supposed to use this class directly, use KImageCache instead.
A simple wrapping layer over KSharedDataCache to support caching images and pixmaps.
void clear()
Removes all entries from the cache.
bool findPixmap(const QString &key, QPixmap *destination) const
Copies the cached pixmap identified by key to destination.
KSharedPixmapCacheMixin(const QString &cacheName, unsigned defaultCacheSize, unsigned expectedItemSize=0)
Constructs an image cache, named by cacheName, with a default size of defaultCacheSize.
bool findImage(const QString &key, QImage *destination) const
Copies the cached image identified by key to destination.
bool insertPixmap(const QString &key, const QPixmap &pixmap)
Inserts the pixmap given by pixmap to the cache, accessible with key.
bool insertImage(const QString &key, const QImage &image)
Inserts the image into the shared cache, accessible with key.
bool isNull() const const
bool loadFromData(QByteArrayView data, const char *format)
bool loadFromData(const QByteArray &data, const char *format, Qt::ImageConversionFlags flags)
QImage toImage() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:48 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.