diff --git a/private/applethandle.cpp b/private/applethandle.cpp index 0ec3df66c..6b412510d 100644 --- a/private/applethandle.cpp +++ b/private/applethandle.cpp @@ -224,6 +224,9 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti Q_UNUSED(widget); if (qFuzzyCompare(m_opacity + 1.0, 1.0)) { + if (m_anim == FadeOut) { + QTimer::singleShot(0, this, SLOT(emitDisappear())); + } return; } @@ -379,6 +382,11 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti painter->restore(); } +void AppletHandle::emitDisappear() +{ + emit disappearDone(this); +} + AppletHandle::ButtonType AppletHandle::mapToButton(const QPointF &point) const { int iconMargin = m_iconSize / 2; @@ -872,10 +880,6 @@ void AppletHandle::fadeAnimation(qreal progress) m_animId = 0; delete m_backgroundBuffer; m_backgroundBuffer = 0; - - if (m_anim == FadeOut) { - emit disappearDone(this); - } } update(); diff --git a/private/applethandle_p.h b/private/applethandle_p.h index d13c0c77c..5e61331e5 100644 --- a/private/applethandle_p.h +++ b/private/applethandle_p.h @@ -74,6 +74,7 @@ class AppletHandle : public QObject, public QGraphicsItem void appletResized(); void fadeIn(); void leaveTimeout(); + void emitDisappear(); private: static const int HANDLE_MARGIN = 3;