Results 1 to 10 of 10

Thread: transparency, setMask, createHeuristicMask, createMaskFromColor, QPixmap

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 38 Times in 30 Posts

    Default Re: transparency, setMask, createHeuristicMask, createMaskFromColor, QPixmap

    I think you're looking for something like an "overlay widget", that is, an invisible surface/layer that you can draw onto, which composes its content straight onto the desktop.

    Afaik[*], Qt doesn't support this on any platform but Qtopia Core, but there are several approaches to "hacking" your way around it. The most common approach is to grab the desktop widget, and draw its contents onto your widget's background. Some people combine this with the Qt::WA_NoSystemBackground flag, which prevents the window system from auto-filling the widget background for every paint event (i.e., you're drawing onto what was there before). It's not a perfect solution by far, but it's what many do today.

    Using masks doesn't really give you a good result; it both looks bad (mal-aliasing edges), and the performance of a complex mask can be... pretty discouraging.

    You and all other Qt developers are waiting for the day that all platforms can support fast top-level alpha composition... When that day comes, Qt is likely to support what you want with a nice easy-to-use interface.
    [*] Disclaimer: This isn't my strongest field.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  2. The following user says thank you to Bitto for this useful post:

    TheKedge (6th February 2007)

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
  •  
Qt is a trademark of The Qt Company.