Qt 6.x
The Qt SDK
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

Since
4.6

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.

References d, and other().

+ Here is the call graph for this function:

◆ Key() [3/3]

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

Definition at line 22 of file qpixmapcache.h.

References other().

+ Here is the call graph for this function:

◆ ~Key()

QPixmapCache::Key::~Key ( )

Destroys the key.

Definition at line 112 of file qpixmapcache.cpp.

References d.

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.

References d.

Referenced by QPMCache::insert(), and QPMCache::remove().

+ Here is the caller graph for this function:

◆ operator!=()

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

Definition at line 26 of file qpixmapcache.h.

References operator==().

+ Here is the call graph for this function:

◆ operator=() [1/2]

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

Definition at line 165 of file qpixmapcache.cpp.

References d, and other().

+ Here is the call graph for this function:

◆ operator=() [2/2]

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

Definition at line 23 of file qpixmapcache.h.

References other(), and swap().

+ Here is the call graph for this function:

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

References d.

◆ swap()

void QPixmapCache::Key::swap ( Key other)
inlinenoexcept
Since
5.6

Definition at line 30 of file qpixmapcache.h.

References d, other(), and qt_ptr_swap().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ qHash

size_t qHash ( const QPixmapCache::Key k,
size_t  seed = 0 
)
friend

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: