PDA

View Full Version : QVariantAnimation causes flickering on QWidget



lamgi667
3rd June 2010, 10:56
Hi,

I'm using Qt 4.6 Cocoa libs under MAC OS X 10.6. I'm trying to create a window which is able to resize animated. Therefor I'm using the QVariantAnimation. If I'm donig so, the resizing causes annoying nimation, Ming, if the widget has actually no parent or/and has window frame with the typical window controls (close-, minimize- maximize button).

The code I'm using is:


QPropertyAnimation* animation = new QPropertyAnimation(this, "size", this);
QSize newSize = this->size();
newSize.setHeight(400);

animation->setEasingCurve( QEasingCurve::InSine);
animation->setDuration(100);

animation->setEndValue(newSize);

QObject::connect(animation, SIGNAL(finished()), this, SLOT(animationDidFinish()));
animation->start( QAbstractAnimation::DeleteWhenStopped );


It doesn't matter if I#m using the size or geometry property. It seems to do this flcikering when updating it's geometry.
Does anyone has an idea how to avoid this?

Thanks
Stefan