diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 5fe77f3..606b5b9 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -376,8 +376,10 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt if (oldRect != newRect || (state & State_Enabled) != (oldState & State_Enabled) || - (state & State_Active) != (oldState & State_Active)) + (state & State_Active) != (oldState & State_Active)) { + qDebug("Stop1"); d->stopAnimation(widget); + } #ifndef QT_NO_LINEEDIT if (const QLineEdit *edit = qobject_cast(widget)) @@ -927,6 +929,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption if (oldRect != newRect || (wasDefault && !isDefault)) { doTransition = false; + qDebug("Stop2"); d->stopAnimation(widget); } @@ -947,6 +950,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption proxy()->drawControl(element, &opt, &startPainter, 0 /* Intentional */); } else { anim->paint(&startPainter, &opt); + qDebug("Stop3"); d->stopAnimation(widget); } @@ -1038,6 +1042,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } } else { + qDebug("Stop4"); d->stopAnimation(widget); XPThemeData theme(widget, painter, name, partId, stateId, rect); d->drawBackground(theme); @@ -1190,9 +1195,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption if (animOffset > animationWidth) { if (bar->progress < bar->maximum) a->setStartTime(QTime::currentTime()); - else + else { + qDebug("Stop5"); d->stopAnimation(widget); //we stop the glow motion only after it has //moved out of view + } } painter->save(); painter->setClipRect(theme.rect); @@ -1604,6 +1611,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle w->setProperty("_q_stylesliderpos", currentPos); if (oldSliderPos != currentPos) { doTransition = false; + qDebug("Stop7"); d->stopAnimation(widget); } } else if (control == CC_SpinBox) { @@ -1614,6 +1622,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle if (oldRect != option->rect) { doTransition = false; + qDebug("Stop8"); d->stopAnimation(widget); } @@ -2440,6 +2449,7 @@ void QWindowsVistaStyle::unpolish(QWidget *widget) QWindowsXPStyle::unpolish(widget); QWindowsVistaStylePrivate *d = const_cast(d_func()); + qDebug("StopUnpolish"); d->stopAnimation(widget); #ifndef QT_NO_LINEEDIT @@ -2539,6 +2549,7 @@ void QWindowsVistaStylePrivate::timerEvent() void QWindowsVistaStylePrivate::stopAnimation(const QWidget *w) { + qDebug() << __FUNCTION__ << w; for (int i = animations.size() - 1 ; i >= 0 ; --i) { if (animations[i]->widget() == w) { QWindowsVistaAnimation *a = animations.takeAt(i); diff --git a/src/gui/styles/qwindowsvistastyle_p.h b/src/gui/styles/qwindowsvistastyle_p.h index 1b0a253..e59329c 100644 --- a/src/gui/styles/qwindowsvistastyle_p.h +++ b/src/gui/styles/qwindowsvistastyle_p.h @@ -140,13 +140,13 @@ QT_BEGIN_NAMESPACE class QWindowsVistaAnimation { public : - QWindowsVistaAnimation() : _running(true) { } - virtual ~QWindowsVistaAnimation() { } + QWindowsVistaAnimation() : _running(true) { qDebug()<< __FUNCTION__ << this ; } + virtual ~QWindowsVistaAnimation() { qDebug()<< __FUNCTION__ << this ; } QWidget * widget() const { return _widget; } bool running() const { return _running; } const QTime &startTime() const { return _startTime; } void setRunning(bool val) { _running = val; } - void setWidget(QWidget *widget) { _widget = widget; } + void setWidget(QWidget *widget) { _widget = widget; qDebug()<< __FUNCTION__ << widget; } void setStartTime(const QTime &startTime) { _startTime = startTime; } virtual void paint(QPainter *painter, const QStyleOption *option);