From 53e8f95ea66d99abb94b46a372d2a775a56d4fb9 Mon Sep 17 00:00:00 2001 From: Andre Duffeck Date: Mon, 15 Oct 2007 09:41:39 +0000 Subject: [PATCH] Fix duration and fadeIn/fadeOut animations svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=725400 --- widgets/flash.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/widgets/flash.cpp b/widgets/flash.cpp index 263139462..ef5a6f3eb 100644 --- a/widgets/flash.cpp +++ b/widgets/flash.cpp @@ -74,6 +74,8 @@ Flash::Flash(QGraphicsItem *parent) d->width = 100 ; d->animId = 0; d->state = Private::Invisible; + + setCachePaintMode( NoCacheMode ); } Flash::~Flash() @@ -140,8 +142,9 @@ void Flash::setFont( const QFont &font ) void Flash::flash( const QString &text, int duration, const QTextOption &option) { + kDebug() << duration << endl; d->type = Private::Text; - d->duration = (duration == 0) ? duration : d->defaultDuration; + d->duration = (duration == 0) ? d->defaultDuration : duration; d->text = text; d->textOption = option; QTimer::singleShot( 0, this, SLOT(fadeIn()) ); @@ -150,7 +153,7 @@ void Flash::flash( const QString &text, int duration, const QTextOption &option) void Flash::flash( const QPixmap &pixmap, int duration, Qt::Alignment align ) { d->type = Private::Pixmap; - d->duration = (duration == 0) ? duration : d->defaultDuration; + d->duration = (duration == 0) ? d->defaultDuration : duration; d->pixmap = pixmap; d->alignment = align; QTimer::singleShot( 0, this, SLOT(fadeIn()) ); @@ -212,7 +215,6 @@ QPixmap Flash::renderPixmap() } return pm; } - void Flash::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option)