Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QPixmapCache::Key Class Reference

The QPixmapCache::Key class can be used for efficient access to the QPixmapCache. More...

#include <qpixmapcache.h>

Collaboration diagram for QPixmapCache::Key:

Public Member Functions

 Key ()
 Constructs an empty Key object.
 Key (const Key &other)
 Key (Key &&other) noexcept
Keyoperator= (Key &&other) noexcept
 ~Key ()
 Destroys the key.
bool operator== (const Key &key) const
bool operator!= (const Key &key) const
Keyoperator= (const Key &other)
void swap (Key &other) noexcept
bool isValid () const noexcept
 Returns true if there is a cached pixmap associated with this key.

Friends

class QPMCache
class QPixmapCache
size_t qHash (const QPixmapCache::Key &k, size_t seed=0) noexcept

Detailed Description

The QPixmapCache::Key class can be used for efficient access to the QPixmapCache.

\inmodule QtGui

Use QPixmapCache::insert() to receive an instance of Key generated by the pixmap cache. You can store the key in your own objects for a very efficient one-to-one object-to-pixmap mapping.

Definition at line 17 of file qpixmapcache.h.

Constructor & Destructor Documentation

◆ Key() [1/3]

QPixmapCache::Key::Key ( )

Constructs an empty Key object.

Definition at line 94 of file qpixmapcache.cpp.

◆ Key() [2/3]

QPixmapCache::Key::Key ( const Key & other)

Constructs a copy of other.

Definition at line 102 of file qpixmapcache.cpp.

◆ Key() [3/3]

QPixmapCache::Key::Key ( Key && other)
inlinenoexcept
Since
5.6

Definition at line 22 of file qpixmapcache.h.

◆ ~Key()

QPixmapCache::Key::~Key ( )

Destroys the key.

Definition at line 112 of file qpixmapcache.cpp.

Member Function Documentation

◆ isValid()

bool QPixmapCache::Key::isValid ( ) const
noexcept

Returns 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

Definition at line 157 of file qpixmapcache.cpp.

◆ operator!=()

bool QPixmapCache::Key::operator!= ( const Key & key) const
inline

Definition at line 26 of file qpixmapcache.h.

◆ operator=() [1/2]

QPixmapCache::Key & QPixmapCache::Key::operator= ( const Key & other)

Definition at line 165 of file qpixmapcache.cpp.

◆ operator=() [2/2]

Key & QPixmapCache::Key::operator= ( Key && other)
inlinenoexcept
Since
5.6

Definition at line 23 of file qpixmapcache.h.

◆ operator==()

bool QPixmapCache::Key::operator== ( const Key & key) const

Returns true if this key is the same as the given key; otherwise returns false.

Definition at line 124 of file qpixmapcache.cpp.

◆ swap()

void QPixmapCache::Key::swap ( Key & other)
inlinenoexcept
Since
5.6 \memberswap{key}

Definition at line 30 of file qpixmapcache.h.

◆ qHash

size_t qHash ( const QPixmapCache::Key & k,
size_t seed = 0 )
friend
Since
6.6 \qhash{QPixmapCache::Key}

Definition at line 34 of file qpixmapcache.h.

◆ QPixmapCache

friend class QPixmapCache
friend

Definition at line 40 of file qpixmapcache.h.

◆ QPMCache

friend class QPMCache
friend

Definition at line 39 of file qpixmapcache.h.


The documentation for this class was generated from the following files: