1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/examples/qqtliveplayer/animationmanager.cpp
2017-10-22 12:21:19 +08:00

41 lines
1.2 KiB
C++

#include "animationmanager.h"
#include "qqtobjectfactory.h"
#include "qqtanimation.h"
#include "qqt-qt.h"
#include "qqtwindow.h"
AnimationManager* AnimationManager::_instance = NULL;
AnimationManager *AnimationManager::Instance(QObject *parent)
{
if(_instance)
return _instance;
_instance = new AnimationManager(parent);
return _instance;
}
AnimationManager::AnimationManager(QObject *parent) : QObject(parent)
{
//init app's all animation
#if 0
/**
* window appear and miss and and animation
* animation start
* step1 label ani0 go..
* user can't decate qqtwindow
*/
QQTWindow* qqtwindow = (QQTWindow*)
QQTObjectFactory::registedObject("QQTWindow");
QQTAnimation* ani = new QQTAnimation(this);
QSequentialAnimationGroup* sani = new QSequentialAnimationGroup(ani);
QParallelAnimationGroup* pani = new QParallelAnimationGroup(ani);
QPropertyAnimation* ani1 = new QPropertyAnimation(qqtwindow, "geometry");
ani1->setDuration(1000);
QRect r1 = qqtwindow->geometry(); r1.setLeft(-800);
ani1->setStartValue(r1);
ani1->setEndValue(qqtwindow->geometry());
sani->addAnimation(ani1);
ani->start();
#endif
}