diff options
Diffstat (limited to 'src/gui/image/qpixmapcache.h')
-rw-r--r-- | src/gui/image/qpixmapcache.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h index 433890c68f..55aad6503f 100644 --- a/src/gui/image/qpixmapcache.h +++ b/src/gui/image/qpixmapcache.h @@ -42,13 +42,30 @@ public: static bool find(const Key &key, QPixmap *pixmap); static bool insert(const QString &key, const QPixmap &pixmap); static Key insert(const QPixmap &pixmap); +#if QT_DEPRECATED_SINCE(6, 6) + QT_DEPRECATED_VERSION_X_6_6("Use remove(key), followed by key = insert(pixmap).") + QT_GUI_INLINE_SINCE(6, 6) static bool replace(const Key &key, const QPixmap &pixmap); +#endif static void remove(const QString &key); static void remove(const Key &key); static void clear(); }; Q_DECLARE_SHARED(QPixmapCache::Key) +#if QT_DEPRECATED_SINCE(6, 6) +#if QT_GUI_INLINE_IMPL_SINCE(6, 6) +bool QPixmapCache::replace(const Key &key, const QPixmap &pixmap) +{ + if (!key.isValid()) + return false; + remove(key); + const_cast<Key&>(key) = insert(pixmap); + return key.isValid(); +} +#endif // QT_GUI_INLINE_IMPL_SINCE(6, 6) +#endif // QT_DEPRECATED_SINCE(6, 6) + QT_END_NAMESPACE #endif // QPIXMAPCACHE_H |