Results 1 to 5 of 5

Thread: What's the correct way of clearing a pixmap?

  1. #1
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default What's the correct way of clearing a pixmap?

    What's the correct way of clearing a pixmap?
    setPixmap( 1, 0 ) will sometimes leave three small dots on the baseline.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: What's the correct way of clearing a pixmap?

    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.

  3. #3
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: What's the correct way of clearing a pixmap?

    Sorry .. I meant for QListViewItem's.
    see http://doc.trolltech.com/3.3/qlistvi...html#setPixmap

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

    Then I want to clear the pixmap!

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: What's the correct way of clearing a pixmap?

    My answer stays the same:
    QListViewItem:ixmap() 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.
    Last edited by high_flyer; 18th January 2006 at 21:09.

  5. #5
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: What's the correct way of clearing a pixmap?

    Thanks!
    Setting a transparent pixmap does the trick.

Similar Threads

  1. Performance problems with small pixmap
    By RThaden in forum Qt Programming
    Replies: 4
    Last Post: 9th July 2008, 15:14
  2. finding maximum scaling of a pixmap
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 31st March 2008, 14:32
  3. empty pixmap as a QLabel
    By tommy in forum Qt Programming
    Replies: 16
    Last Post: 11th December 2007, 21:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.