blob: 2a04f64b475f3c51f02d3ec3bfd22330f3bde12d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
//! [0]
QPixmap* pp;
QPixmap p;
if ((pp=QPixmapCache::find("my_big_image", pm))) {
p = *pp;
} else {
p.load("bigimage.png");
QPixmapCache::insert("my_big_image", new QPixmap(p));
}
painter->drawPixmap(0, 0, p);
//! [0]
//! [1]
QPixmap pm;
if (!QPixmapCache::find("my_big_image", &pm)) {
pm.load("bigimage.png");
QPixmapCache::insert("my_big_image", pm);
}
painter->drawPixmap(0, 0, pm);
//! [1]
|