demos/sub-attaq/animationmanager.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    60     return instance;
    60     return instance;
    61 }
    61 }
    62 
    62 
    63 void AnimationManager::registerAnimation(QAbstractAnimation *anim)
    63 void AnimationManager::registerAnimation(QAbstractAnimation *anim)
    64 {
    64 {
       
    65     QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*)));
    65     animations.append(anim);
    66     animations.append(anim);
       
    67 }
       
    68 
       
    69 void AnimationManager::unregisterAnimation_helper(QObject *obj)
       
    70 {
       
    71     unregisterAnimation(static_cast<QAbstractAnimation*>(obj));
    66 }
    72 }
    67 
    73 
    68 void AnimationManager::unregisterAnimation(QAbstractAnimation *anim)
    74 void AnimationManager::unregisterAnimation(QAbstractAnimation *anim)
    69 {
    75 {
       
    76     QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*)));
    70     animations.removeAll(anim);
    77     animations.removeAll(anim);
    71 }
    78 }
    72 
    79 
    73 void AnimationManager::unregisterAllAnimations()
    80 void AnimationManager::unregisterAllAnimations()
    74 {
    81 {