Results 1 to 2 of 2

Thread: How to setMask without aliasing

  1. #1
    Join Date
    Feb 2007
    Posts
    14
    Thanks
    3

    Default How to setMask without aliasing

    Hello all. I'm having such a problem: I want to make a clock widget with visible area only of this clock. The clock's shape is the same as in QT examples/widgets/shapedclock, but as in this example the widget's outline doesn't look smooth. I used QWidget::setMask( const QRegion &) but it didn't help, the outline is still aliased. Then I used QWidget::setMask( const QBitmap &) - the same thing. In the case with QBitmap I think the reason is that QBitmap has only one bit 0 or 1 and no mixed colors for antialiasing.
    I also tried QWidget::setAttribute(Qt::WA_NoSystemBackground, true) but the widget has no parent and background is painted in black color, it doesn't transparent. Can anybody help me to make the visible area of widget to be smooth ?

  2. #2
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to setMask without aliasing

    Maybe setting a PNG mask you put as a resource in your binary, if the PNG mask's "outline" is semi-transparent, maybe your widget will have the same smoothness?

    Dont know if it makes sense ^^
    Pierre.

Similar Threads

  1. QT 4.2 widget setmask problem
    By PiXeL16 in forum Qt Programming
    Replies: 16
    Last Post: 2nd March 2007, 07:09

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.