diff options
-rw-r--r-- | src/gui/image/qpixmapcache.cpp | 11 | ||||
-rw-r--r-- | src/gui/image/qpixmapcache.h | 4 | ||||
-rw-r--r-- | src/gui/image/qpixmapcache_p.h | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index a57f1444645..46398582568 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -218,10 +218,15 @@ QT_BEGIN_INCLUDE_NAMESPACE #include "qpixmapcache.moc" QT_END_INCLUDE_NAMESPACE -size_t qHash(const QPixmapCache::Key &k, size_t seed) +/*! + size_t QPixmapCache::qHash(const Key &key, size_t seed = 0); + \since 6.6 + + Returns the hash value for the \a key, using \a seed to seed the calculation. +*/ +size_t QPixmapCache::Key::hash(size_t seed) const noexcept { - const auto *keyData = QPMCache::get(k); - return qHash(keyData ? keyData->key : 0, seed); + return qHash(this->d ? this->d->key : 0, seed); } QPMCache::QPMCache() diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h index 55aad6503f3..72ee1b797fa 100644 --- a/src/gui/image/qpixmapcache.h +++ b/src/gui/image/qpixmapcache.h @@ -31,6 +31,10 @@ public: bool isValid() const noexcept; private: + friend size_t qHash(const QPixmapCache::Key &k, size_t seed = 0) noexcept + { return k.hash(seed); } + size_t hash(size_t seed) const noexcept; + KeyData *d; friend class QPMCache; friend class QPixmapCache; diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h index c9a90563015..43c4d9784c6 100644 --- a/src/gui/image/qpixmapcache_p.h +++ b/src/gui/image/qpixmapcache_p.h @@ -23,8 +23,6 @@ QT_BEGIN_NAMESPACE -size_t qHash(const QPixmapCache::Key &k, size_t seed = 0); - class QPixmapCache::KeyData { public: |