[][src]Struct qt_gui::QPixmapCache

#[repr(C)]pub struct QPixmapCache { /* fields omitted */ }

The QPixmapCache class provides an application-wide cache for pixmaps.

C++ class: QPixmapCache.

C++ documentation:

The QPixmapCache class provides an application-wide cache for pixmaps.

This class is a tool for optimized drawing with QPixmap. You can use it to store temporary pixmaps that are expensive to generate without using more storage space than cacheLimit(). Use insert() to insert pixmaps, find() to find them, and clear() to empty the cache.

QPixmapCache contains no member data, only static functions to access the global pixmap cache. It creates an internal QCache object for caching the pixmaps.

The cache associates a pixmap with a user-provided string as a key, or with a QPixmapCache::Key that the cache generates. Using QPixmapCache::Key for keys is faster than using strings. The string API is very convenient for complex keys but the QPixmapCache::Key API will be very efficient and convenient for a one-to-one object-to-pixmap mapping - in this case, you can store the keys as members of an object.

If two pixmaps are inserted into the cache using equal keys then the last pixmap will replace the first pixmap in the cache. This follows the behavior of the QHash and QCache classes.

The cache becomes full when the total size of all pixmaps in the cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (width * height * depth)/8 bytes of memory.

The Qt Quarterly article Optimizing with QPixmapCache explains how to use QPixmapCache to speed up applications by caching the results of painting.

Methods

impl QPixmapCache[src]

pub unsafe fn cache_limit() -> c_int[src]

Returns the cache limit (in kilobytes).

Calls C++ function: static int QPixmapCache::cacheLimit().

C++ documentation:

Returns the cache limit (in kilobytes).

The default cache limit is 10240 KB.

See also setCacheLimit().

pub unsafe fn clear()[src]

Removes all pixmaps from the cache.

Calls C++ function: static void QPixmapCache::clear().

C++ documentation:

Removes all pixmaps from the cache.

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QPixmapCache>>
) -> Ref<QPixmapCache>
[src]

The QPixmapCache class provides an application-wide cache for pixmaps.

Calls C++ function: QPixmapCache& QPixmapCache::operator=(const QPixmapCache& other).

C++ documentation:

The QPixmapCache class provides an application-wide cache for pixmaps.

This class is a tool for optimized drawing with QPixmap. You can use it to store temporary pixmaps that are expensive to generate without using more storage space than cacheLimit(). Use insert() to insert pixmaps, find() to find them, and clear() to empty the cache.

QPixmapCache contains no member data, only static functions to access the global pixmap cache. It creates an internal QCache object for caching the pixmaps.

The cache associates a pixmap with a user-provided string as a key, or with a QPixmapCache::Key that the cache generates. Using QPixmapCache::Key for keys is faster than using strings. The string API is very convenient for complex keys but the QPixmapCache::Key API will be very efficient and convenient for a one-to-one object-to-pixmap mapping - in this case, you can store the keys as members of an object.

If two pixmaps are inserted into the cache using equal keys then the last pixmap will replace the first pixmap in the cache. This follows the behavior of the QHash and QCache classes.

The cache becomes full when the total size of all pixmaps in the cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (width * height * depth)/8 bytes of memory.

The Qt Quarterly article Optimizing with QPixmapCache explains how to use QPixmapCache to speed up applications by caching the results of painting.

pub unsafe fn find_q_string(key: impl CastInto<Ref<QString>>) -> Ptr<QPixmap>[src]

Use bool find(const QString&, QPixmap*) instead.

Calls C++ function: static QPixmap* QPixmapCache::find(const QString& key).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for static bool QPixmapCache::find(const QString &key, QPixmap &pixmap):

Use bool find(const QString&, QPixmap*) instead.

pub unsafe fn find_q_string_q_pixmap(
    key: impl CastInto<Ref<QString>>,
    pixmap: impl CastInto<Ref<QPixmap>>
) -> bool
[src]

Use bool find(const QString&, QPixmap*) instead.

Calls C++ function: static bool QPixmapCache::find(const QString& key, QPixmap& pixmap).

C++ documentation:

Use bool find(const QString&, QPixmap*) instead.

pub unsafe fn find_q_string_q_pixmap2(
    key: impl CastInto<Ref<QString>>,
    pixmap: impl CastInto<Ptr<QPixmap>>
) -> bool
[src]

Use bool find(const QString&, QPixmap*) instead.

Calls C++ function: static bool QPixmapCache::find(const QString& key, QPixmap* pixmap).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for static bool QPixmapCache::find(const QString &key, QPixmap &pixmap):

Use bool find(const QString&, QPixmap*) instead.

pub unsafe fn find_key_q_pixmap(
    key: impl CastInto<Ref<Key>>,
    pixmap: impl CastInto<Ptr<QPixmap>>
) -> bool
[src]

Use bool find(const QString&, QPixmap*) instead.

Calls C++ function: static bool QPixmapCache::find(const QPixmapCache::Key& key, QPixmap* pixmap).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for static bool QPixmapCache::find(const QString &key, QPixmap &pixmap):

Use bool find(const QString&, QPixmap*) instead.

pub unsafe fn insert_2a(
    key: impl CastInto<Ref<QString>>,
    pixmap: impl CastInto<Ref<QPixmap>>
) -> bool
[src]

Inserts a copy of the pixmap pixmap associated with the key into the cache.

Calls C++ function: static bool QPixmapCache::insert(const QString& key, const QPixmap& pixmap).

C++ documentation:

Inserts a copy of the pixmap pixmap associated with the key into the cache.

All pixmaps inserted by the Qt library have a key starting with "$qt", so your own pixmap keys should never begin "$qt".

When a pixmap is inserted and the cache is about to exceed its limit, it removes pixmaps until there is enough room for the pixmap to be inserted.

The oldest pixmaps (least recently accessed in the cache) are deleted when more space is needed.

The function returns true if the object was inserted into the cache; otherwise it returns false.

See also setCacheLimit().

pub unsafe fn insert_1a(pixmap: impl CastInto<Ref<QPixmap>>) -> CppBox<Key>[src]

Inserts a copy of the given pixmap into the cache and returns a key that can be used to retrieve it.

Calls C++ function: static QPixmapCache::Key QPixmapCache::insert(const QPixmap& pixmap).

C++ documentation:

Inserts a copy of the given pixmap into the cache and returns a key that can be used to retrieve it.

When a pixmap is inserted and the cache is about to exceed its limit, it removes pixmaps until there is enough room for the pixmap to be inserted.

The oldest pixmaps (least recently accessed in the cache) are deleted when more space is needed.

This function was introduced in Qt 4.6.

See also setCacheLimit() and replace().

pub unsafe fn new() -> CppBox<QPixmapCache>[src]

The QPixmapCache class provides an application-wide cache for pixmaps.

Calls C++ function: [constructor] void QPixmapCache::QPixmapCache().

C++ documentation:

The QPixmapCache class provides an application-wide cache for pixmaps.

This class is a tool for optimized drawing with QPixmap. You can use it to store temporary pixmaps that are expensive to generate without using more storage space than cacheLimit(). Use insert() to insert pixmaps, find() to find them, and clear() to empty the cache.

QPixmapCache contains no member data, only static functions to access the global pixmap cache. It creates an internal QCache object for caching the pixmaps.

The cache associates a pixmap with a user-provided string as a key, or with a QPixmapCache::Key that the cache generates. Using QPixmapCache::Key for keys is faster than using strings. The string API is very convenient for complex keys but the QPixmapCache::Key API will be very efficient and convenient for a one-to-one object-to-pixmap mapping - in this case, you can store the keys as members of an object.

If two pixmaps are inserted into the cache using equal keys then the last pixmap will replace the first pixmap in the cache. This follows the behavior of the QHash and QCache classes.

The cache becomes full when the total size of all pixmaps in the cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (width * height * depth)/8 bytes of memory.

The Qt Quarterly article Optimizing with QPixmapCache explains how to use QPixmapCache to speed up applications by caching the results of painting.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QPixmapCache>>
) -> CppBox<QPixmapCache>
[src]

The QPixmapCache class provides an application-wide cache for pixmaps.

Calls C++ function: [constructor] void QPixmapCache::QPixmapCache(const QPixmapCache& other).

C++ documentation:

The QPixmapCache class provides an application-wide cache for pixmaps.

This class is a tool for optimized drawing with QPixmap. You can use it to store temporary pixmaps that are expensive to generate without using more storage space than cacheLimit(). Use insert() to insert pixmaps, find() to find them, and clear() to empty the cache.

QPixmapCache contains no member data, only static functions to access the global pixmap cache. It creates an internal QCache object for caching the pixmaps.

The cache associates a pixmap with a user-provided string as a key, or with a QPixmapCache::Key that the cache generates. Using QPixmapCache::Key for keys is faster than using strings. The string API is very convenient for complex keys but the QPixmapCache::Key API will be very efficient and convenient for a one-to-one object-to-pixmap mapping - in this case, you can store the keys as members of an object.

If two pixmaps are inserted into the cache using equal keys then the last pixmap will replace the first pixmap in the cache. This follows the behavior of the QHash and QCache classes.

The cache becomes full when the total size of all pixmaps in the cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (width * height * depth)/8 bytes of memory.

The Qt Quarterly article Optimizing with QPixmapCache explains how to use QPixmapCache to speed up applications by caching the results of painting.

pub unsafe fn remove_q_string(key: impl CastInto<Ref<QString>>)[src]

Removes the pixmap associated with key from the cache.

Calls C++ function: static void QPixmapCache::remove(const QString& key).

C++ documentation:

Removes the pixmap associated with key from the cache.

pub unsafe fn remove_key(key: impl CastInto<Ref<Key>>)[src]

Removes the pixmap associated with key from the cache and releases the key for a future insertion.

Calls C++ function: static void QPixmapCache::remove(const QPixmapCache::Key& key).

C++ documentation:

Removes the pixmap associated with key from the cache and releases the key for a future insertion.

This function was introduced in Qt 4.6.

pub unsafe fn replace(
    key: impl CastInto<Ref<Key>>,
    pixmap: impl CastInto<Ref<QPixmap>>
) -> bool
[src]

Replaces the pixmap associated with the given key with the pixmap specified. Returns true if the pixmap has been correctly inserted into the cache; otherwise returns false.

Calls C++ function: static bool QPixmapCache::replace(const QPixmapCache::Key& key, const QPixmap& pixmap).

C++ documentation:

Replaces the pixmap associated with the given key with the pixmap specified. Returns true if the pixmap has been correctly inserted into the cache; otherwise returns false.

This function was introduced in Qt 4.6.

See also setCacheLimit() and insert().

pub unsafe fn set_cache_limit(arg1: c_int)[src]

Sets the cache limit to n kilobytes.

Calls C++ function: static void QPixmapCache::setCacheLimit(int arg1).

C++ documentation:

Sets the cache limit to n kilobytes.

The default setting is 10240 KB.

See also cacheLimit().

Trait Implementations

impl CppDeletable for QPixmapCache[src]

unsafe fn delete(&self)[src]

The QPixmapCache class provides an application-wide cache for pixmaps.

Calls C++ function: [destructor] void QPixmapCache::~QPixmapCache().

C++ documentation:

The QPixmapCache class provides an application-wide cache for pixmaps.

This class is a tool for optimized drawing with QPixmap. You can use it to store temporary pixmaps that are expensive to generate without using more storage space than cacheLimit(). Use insert() to insert pixmaps, find() to find them, and clear() to empty the cache.

QPixmapCache contains no member data, only static functions to access the global pixmap cache. It creates an internal QCache object for caching the pixmaps.

The cache associates a pixmap with a user-provided string as a key, or with a QPixmapCache::Key that the cache generates. Using QPixmapCache::Key for keys is faster than using strings. The string API is very convenient for complex keys but the QPixmapCache::Key API will be very efficient and convenient for a one-to-one object-to-pixmap mapping - in this case, you can store the keys as members of an object.

If two pixmaps are inserted into the cache using equal keys then the last pixmap will replace the first pixmap in the cache. This follows the behavior of the QHash and QCache classes.

The cache becomes full when the total size of all pixmaps in the cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (width * height * depth)/8 bytes of memory.

The Qt Quarterly article Optimizing with QPixmapCache explains how to use QPixmapCache to speed up applications by caching the results of painting.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.