mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
QWidgetAnimator cleanup
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
faa778989e
commit
8117f7df04
2 changed files with 11 additions and 5 deletions
|
@ -47,8 +47,14 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QWidgetAnimator::QWidgetAnimator(QMainWindowLayout *layout) : m_mainWindowLayout(layout)
|
||||
QWidgetAnimator::QWidgetAnimator(QMainWindowLayout *layout)
|
||||
#ifndef QT_NO_MAINWINDOW
|
||||
: m_mainWindowLayout(layout)
|
||||
#endif
|
||||
{
|
||||
#ifdef QT_NO_MAINWINDOW
|
||||
Q_UNUSED(m_mainWindowLayout);
|
||||
#endif
|
||||
}
|
||||
|
||||
void QWidgetAnimator::abort(QWidget *w)
|
||||
|
@ -60,6 +66,7 @@ void QWidgetAnimator::abort(QWidget *w)
|
|||
anim->stop();
|
||||
anim->deleteLater();
|
||||
}
|
||||
locker.unlock();
|
||||
#ifndef QT_NO_MAINWINDOW
|
||||
m_mainWindowLayout->animationFinished(w);
|
||||
#endif
|
||||
|
@ -98,7 +105,7 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo
|
|||
anim->setDuration(animate ? 200 : 0);
|
||||
anim->setEasingCurve(QEasingCurve::InOutQuad);
|
||||
anim->setEndValue(final_geometry);
|
||||
m_animation_map[widget] = anim;
|
||||
m_animation_map.insert(widget, anim);
|
||||
locker.unlock();
|
||||
connect(anim, SIGNAL(finished()), this, SLOT(animationFinished()));
|
||||
anim->start(QPropertyAnimation::DeleteWhenStopped);
|
||||
|
|
|
@ -55,8 +55,7 @@
|
|||
|
||||
#include <qobject.h>
|
||||
#include <qmap.h>
|
||||
#include <qpointer.h>
|
||||
#include <QMutex>
|
||||
#include <qmutex.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -81,7 +80,7 @@ private Q_SLOTS:
|
|||
#endif
|
||||
|
||||
private:
|
||||
typedef QMap<QWidget*, QPointer<QPropertyAnimation> > AnimationMap;
|
||||
typedef QMap<QWidget*, QPropertyAnimation*> AnimationMap;
|
||||
AnimationMap m_animation_map;
|
||||
QMainWindowLayout *m_mainWindowLayout;
|
||||
QMutex m_mutex;
|
||||
|
|
Loading…
Add table
Reference in a new issue