PDA

View Full Version : What's the correct way of clearing a pixmap?



karye
18th January 2006, 18:25
What's the correct way of clearing a pixmap?
setPixmap( 1, 0 ) will sometimes leave three small dots on the baseline.

high_flyer
18th January 2006, 18:40
I don't understand how do you clear a pixmap with setPixmap(1,0)?
QPixmap does not have a setPixmap() method, QLabel does...

Any way, I think that QPixmap::fill() is what you need.

karye
18th January 2006, 19:18
Sorry .. I meant for QListViewItem's.
see http://doc.trolltech.com/3.3/qlistviewitem.html#setPixmap

First I've set with:
setPixmap( 1, pxQueued );

Then I want to clear the pixmap!

high_flyer
18th January 2006, 22:02
My answer stays the same:
QListViewItem::pixmap() return the pixmap on which you can call fill().
EDIT: by the way setPixmap(1,0) is not clearing the pixmap, but sets a null pixamp (i.e it sets no pixamp) in the QListViewItem.

karye
19th January 2006, 18:46
Thanks!
Setting a transparent pixmap does the trick.