Results 1 to 3 of 3

Thread: setMask Problems

  1. #1
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default setMask Problems

    I need to cut in half a widget a few times, so I decided to use masks, the only thing is that I can't get them to work with rectangles.
    So this does not work:
    Qt Code:
    1. QRegion maskedRegion(0,0,width(),height()/2);
    2. setMask(maskedRegion);
    To copy to clipboard, switch view to plain text mode 
    However, this does (but doesn't get me what I want seeing as its an ellipse):
    Qt Code:
    1. QRegion maskedRegion(0,0,width(),height()/2,QRegion::Ellipse);
    2. setMask(maskedRegion);
    To copy to clipboard, switch view to plain text mode 

    Right now I call these from outside a resize event, however when I tried from within one all I got was a black section where the mask should have been.


    Is there some method that I have to call afterwards of something? I've tried update and repaint but no success.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: setMask Problems

    Could you, by any chance, provide something compilable we can test ourselves?
    J-P Nurmi

  3. #3
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: setMask Problems

    I found out it was compiz, I ran the same program with kwin and the masking was fine, apparently compiz has problems with masks.

    Thanks anyways :-)

Similar Threads

  1. canonicalFilePath() thread problems
    By magland in forum Qt Programming
    Replies: 10
    Last Post: 5th December 2007, 21:22
  2. Replies: 2
    Last Post: 8th March 2007, 22:22
  3. problems i faced with QT-3
    By jineesh in forum Newbie
    Replies: 4
    Last Post: 4th January 2007, 14:44
  4. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11
  5. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39

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.