Don't use deprecated QPixmapCache::find overload

Silence compile time warning and show correct usage in example
snippet.

Change-Id: I1936f006e4b5f3ca71bbc0100ed039beeb459271
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
Volker Hilsheimer 2020-03-03 11:16:58 +01:00
parent 048f0a00fa
commit 295a16b0d3
2 changed files with 2 additions and 3 deletions

View File

@ -49,9 +49,8 @@
****************************************************************************/
//! [0]
QPixmap* pp;
QPixmap p;
if ((pp=QPixmapCache::find("my_big_image", pm))) {
if (QPixmap *pp = QPixmapCache::find("my_big_image"))) {
p = *pp;
} else {
p.load("bigimage.png");

View File

@ -6125,7 +6125,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
const QString cacheKey = QLatin1String("qt_mac_constructQIconFromIconRef") + QString::number(standardIcon) + QString::number(size.width());
if (standardIcon >= QStyle::SP_CustomBase) {
mainIcon = theme->standardPixmap(sp, QSizeF(size));
} else if (QPixmapCache::find(cacheKey, mainIcon) == false) {
} else if (QPixmapCache::find(cacheKey, &mainIcon) == false) {
mainIcon = theme->standardPixmap(sp, QSizeF(size));
QPixmapCache::insert(cacheKey, mainIcon);
}