QPixmapCache::Key Class

class QPixmapCache::Key

QPixmapCache::Key 类可用于高效访问QPixmapCache... 更多...

公共函数

Key()
~Key()
bool isValid() const
void swap(QPixmapCache::Key &other)
(since 6.6) size_t qHash(const QPixmapCache::Key &key, size_t seed = 0)

详细说明

使用QPixmapCache::insert() 接收由像素图缓存生成的 Key 实例。您可以将密钥存储在自己的对象中,以实现高效的一对一对象到像素图映射。

成员函数文档

Key::Key()

构造一个空的 Key 对象。

[noexcept] Key::~Key()

销毁钥匙。

[noexcept] bool Key::isValid() const

如果存在与此键相关的缓存像素图,则返回true 。否则,如果像素图被刷新,则密钥不再有效。

[noexcept] void Key::swap(QPixmapCache::Key &other)

将此键与other 互换。此操作速度非常快,从未出现过故障。

相关非会员

[noexcept, since 6.6] size_t qHash(const QPixmapCache::Key &key, size_t seed = 0)

返回key 的哈希值,使用seed 作为计算的种子。

此函数在 Qt 6.6 中引入。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.