- Qt 6.8
- Qt GUI
- C++ Classes
- QPixmapCache
- Qt 6.8.0 Reference Documentation

# Obsolete Members for QPixmapCache

The following members of class QPixmapCache are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

## Static Public Members

`(deprecated in 6.6)` bool | replace(const QPixmapCache::Key &key, const QPixmap &pixmap)

## Member Function Documentation

### `[static, deprecated in 6.6]` bool QPixmapCache::replace(const QPixmapCache::Key &key, const QPixmap &pixmap)

This function is deprecated since 6.6. We strongly advise against using it in new code.

Use `remove(key); key = insert(pixmap);` instead.

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`.

The passed key is updated to reference pixmap now. Other copies of key, if any, still refer to the old pixmap, which is, however, removed from the cache by this function.

See also setCacheLimit() and insert().