PDA

View Full Version : How to setMask without aliasing



burkav84
10th April 2007, 15:10
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 ?

hickscorp
10th April 2007, 16:51
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.