Obsolete Members for QPixmapCache

QPixmapCache 类的以下成员已被弃用。提供这些成员是为了确保旧源代码能够继续运行。我们强烈建议不要在新代码中使用它们。

静态公共成员

(deprecated in 6.6) bool replace(const QPixmapCache::Key &key, const QPixmap &pixmap)

成员函数文档

[static, deprecated in 6.6] bool QPixmapCache::replace(const QPixmapCache::Key &key, const QPixmap &pixmap)

自 6.6 版本起,此函数已弃用。我们强烈建议不要在新代码中使用它。

请改用remove(key); key = insert(pixmap); 。

将与给定 `key ` 关联的像素图替换为指定的 `pixmap `。如果 `pixmap ` 已正确插入缓存,则返回 `true `;否则返回 `false`。

传入的key 现已更新为引用pixmap 。如果存在其他key 的副本,它们仍引用旧的位图,但该位图已被本函数从缓存中移除。

另请参阅 setCacheLimit() 和insert()。

© 2026 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.