+ Reply to Thread
Results 1 to 2 of 2

Thread: QPixmap::setMask() / QWidget::setMask()

  1. #1
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Lightbulb QPixmap::setMask() / QWidget::setMask()

    Two methods that i have tried for displaying clipped image:-

    1.================
    pixmap->setMask(bitmap1);
    painter->drawPixmap(pixmap);

    2.================
    widget->setMask(bitmap1);
    painter->drawPixmap(pixmap);

    Both methods works correctly (at least in my case) i.e. displays clipped image.

    But i'm still confused which method should i use; or should i combine both methods like this: -
    pixmap->setMask(bitmap1);
    widget->setMask(bitmap1);
    painter->drawPixmap(pixmap);

    So, please help.

    EDIT: I'm using qt 4.1.1
    Last edited by yogeshm02; 25th February 2006 at 12:26.

  2. #2
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QPixmap::setMask() / QWidget::setMask()

    On second thought it seems that correct way is to use method #2; and if need be, use pixmap->setMask(bitmap1) along with that.

+ Reply to Thread

Similar Threads

  1. QWidget::setMask: bug &/or help for workaround
    By ataffard in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2008, 08:34

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