Fix doc bug 794 - "QPixmapCache.find example is wrong"
This commit is contained in:
parent
9024884495
commit
f8bc57c61c
1 changed files with 4 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
//! [0]
|
//! [0]
|
||||||
pm = QPixmapCache.find("my_big_image")
|
pm = QPixmap()
|
||||||
if not pm.isNull():
|
if not QPixmapCache.find("my_big_image", pm):
|
||||||
pm.load("bigimage.png")
|
pm.load("bigimage.png")
|
||||||
QPixmapCache.insert("my_big_image", pm)
|
QPixmapCache.insert("my_big_image", pm)
|
||||||
painter.drawPixmap(0, 0, pm)
|
painter.drawPixmap(0, 0, pm)
|
||||||
|
|
@ -8,8 +8,8 @@ painter.drawPixmap(0, 0, pm)
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
//! [1]
|
||||||
pm = QPixmapCache.find("my_big_image")
|
pm = QPixmap()
|
||||||
if not pm.isNull():
|
if not QPixmapCache.find("my_big_image", pm):
|
||||||
pm.load("bigimage.png")
|
pm.load("bigimage.png")
|
||||||
QPixmapCache.insert("my_big_image", pm)
|
QPixmapCache.insert("my_big_image", pm)
|
||||||
painter.drawPixmap(0, 0, pm)
|
painter.drawPixmap(0, 0, pm)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue