diff options
author | Serge Lysenko <sergii.lysenko@avid.com> | 2015-08-21 19:58:49 +0300 |
---|---|---|
committer | Serge Lysenko <sergii.lysenko@avid.com> | 2015-09-18 13:48:05 +0000 |
commit | 8f68d15789c78c97a4cf1a2c85ec1753a2536032 (patch) | |
tree | aa442e012c8942facecdcb0ccdb43b7beedfbced /src/gui | |
parent | 0d3464428e4632f3ec905766baf778d3355dd80c (diff) |
Add method for checking of QPixmapCache::Key validity
We need a method to check whether a specified pixmap is still
cached without touching the recently-accessed list for this pixmap.
[ChangeLog][QtGui][QPixmapCache] Added QPixmapCache::Key::isValid().
Change-Id: I90fa4f67b569099b67b6207e78494beb3111b68e
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qpixmapcache.cpp | 10 | ||||
-rw-r--r-- | src/gui/image/qpixmapcache.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 71a79745e8..04e1d442b0 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -156,6 +156,16 @@ bool QPixmapCache::Key::operator ==(const Key &key) const */ /*! + Returns \c true if there is a cached pixmap associated with this key. + Otherwise, if pixmap was flushed, the key is no longer valid. + \since 5.7 +*/ +bool QPixmapCache::Key::isValid() const Q_DECL_NOTHROW +{ + return d && d->isValid; +} + +/*! \internal */ QPixmapCache::Key &QPixmapCache::Key::operator =(const Key &other) diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h index 37a0588e06..ca18f299a7 100644 --- a/src/gui/image/qpixmapcache.h +++ b/src/gui/image/qpixmapcache.h @@ -59,6 +59,7 @@ public: Key &operator =(const Key &other); void swap(Key &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + bool isValid() const Q_DECL_NOTHROW; private: KeyData *d; |