1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

添加动画控制器

This commit is contained in:
tianduanrui 2017-08-15 10:44:24 +08:00
parent f6e589cd9f
commit 6dc209169f
8 changed files with 129 additions and 22 deletions

6
qqtanimation.cpp Normal file
View File

@ -0,0 +1,6 @@
#include "qqtanimation.h"
QQTAnimation::QQTAnimation(QObject *parent) : QParallelAnimationGroup(parent)
{
}

22
qqtanimation.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef QQTANIMATION_H
#define QQTANIMATION_H
#include <QPauseAnimation>
#include <QParallelAnimationGroup>
#include <QSequentialAnimationGroup>
#include <QSequentialIterable>
#include <QPropertyAnimation>
class QQTAnimation : public QParallelAnimationGroup
{
Q_OBJECT
public:
explicit QQTAnimation(QObject *parent = nullptr);
signals:
public slots:
};
#endif // QQTANIMATION_H

15
qqtanimationmanager.cpp Normal file
View File

@ -0,0 +1,15 @@
#include "qqtanimationmanager.h"
QQTAnimationManager* QQTAnimationManager::_instance = NULL;
QQTAnimationManager *QQTAnimationManager::Instance(QObject *parent)
{
if(_instance)
return _instance;
_instance = new QQTAnimationManager(parent);
return _instance;
}
QQTAnimationManager::QQTAnimationManager(QObject *parent) : QObject(parent)
{
}

30
qqtanimationmanager.h Normal file
View File

@ -0,0 +1,30 @@
#ifndef QQTANIMATIONMANAGER_H
#define QQTANIMATIONMANAGER_H
#include <QObject>
#include "qqtobjectfactory.h"
#include "qqtanimation.h"
#include "qqtgui-qt.h"
/**
* @brief The QQTAnimationManager class
* @brief 使
* @brief AppAnimationManager模仿此类编写
* @brief
*/
class QQTAnimationManager : public QObject
{
Q_OBJECT
public:
static QQTAnimationManager *Instance(QObject* parent = 0);
signals:
public slots:
protected:
explicit QQTAnimationManager(QObject *parent = nullptr);
private:
static QQTAnimationManager* _instance;
};
#endif // QQTANIMATIONMANAGER_H

View File

@ -133,7 +133,9 @@ SOURCES += $$PWD/qqtcheckbox.cpp \
$$PWD/qqtserialmessage.cpp \
$$PWD/qqtnetworkmessage.cpp \
$$PWD/qqtuserserialprotocol.cpp \
$$PWD/qqtlanprotocol.cpp
$$PWD/qqtlanprotocol.cpp \
$$PWD/qqtanimation.cpp \
$$PWD/qqtanimationmanager.cpp
HEADERS += $$PWD/qqtcheckbox.h \
$$PWD/qqtdefine.h \
@ -187,7 +189,9 @@ HEADERS += $$PWD/qqtcheckbox.h \
$$PWD/qqtserialmessage.h \
$$PWD/qqtnetworkmessage.h \
$$PWD/qqtuserserialprotocol.h \
$$PWD/qqtlanprotocol.h
$$PWD/qqtlanprotocol.h \
$$PWD/qqtanimation.h \
$$PWD/qqtanimationmanager.h
FORMS += $$PWD/qqtcheckbox.ui \

View File

@ -58,13 +58,27 @@
#include <QLayout>
#include <QTableView>
#include <QItemSelectionModel>
#include <QItemDelegate>
#include <QSqlRelationalDelegate>
#include <QSqlTableModel>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QSqlError>
#include <QItemSelectionModel>
#include <QItemDelegate>
#include <QAnimationGroup>
#include <QPauseAnimation>
#include <QVariantAnimation>
#include <QParallelAnimationGroup>
#include <QSequentialAnimationGroup>
#include <QSequentialIterable>
#include <QPropertyAnimation>
#include <QState>
#include <QStateMachine>
#include <QSignalTransition>
#include <QEventTransition>
#include <QTimeLine>
#endif // QQTGUIQT_H

View File

@ -15,15 +15,12 @@
class QQTObjectFactory
{
public:
template<typename T>
static void registerClass()
{
/*
* Hash
*/
constructors().insert( T::staticMetaObject.className(), &constructorHelper<T> );
}
/**
* @brief createObject
* @param className
* @param parent
* @return
*/
static QObject* createObject( const QByteArray& className, QObject* parent = NULL )
{
/*
@ -37,12 +34,18 @@ public:
*/
return (*constructor)( parent );
}
/**
* @brief registerObject
* @param w
*/
static void registerObject(const QObject * const& w)
{
containers().push_back(w);
}
/**
* @brief unregisterObject
* @param w
*/
static void unregisterObject(const QObject*& w)
{
QListIterator<const QObject*> itor(containers());
@ -56,7 +59,11 @@ public:
}
}
}
/**
* @brief registedObject ObjectName
* @param objName
* @return
*/
static const QObject* registedObject(const QString objName)
{
QListIterator<const QObject*> itor(containers());
@ -88,6 +95,15 @@ private:
return instance;
}
template<typename T>
static void registerClass()
{
/*
* Hash
*/
constructors().insert( T::staticMetaObject.className(), &constructorHelper<T> );
}
private:
static QList<const QObject*>& containers()
{

View File

@ -8,14 +8,14 @@
#define VER_PRODUCTVERSION_STR "1.0" //产品版本
#define VER_COMPANYNAME_STR "QQT"
#define VER_FILEDESCRIPTION_STR "K1160 Digest" //文件说明
#define VER_INTERNALNAME_STR "K1160"
#define VER_LEGALCOPYRIGHT_STR "Copyright 2007-2016 QQT Co., Ltd." //版权
#define VER_FILEDESCRIPTION_STR "QQT" //文件说明
#define VER_INTERNALNAME_STR "QQT"
#define VER_LEGALCOPYRIGHT_STR "Copyright 2007-2017 QQT Co., Ltd." //版权
#define VER_LEGALTRADEMARKS1_STR "All rights reserved"
#define VER_LEGALTRADEMARKS2_STR VER_LEGALTRADEMARKS1_STR
#define VER_ORIGINALFILENAME_STR "K1160" //原始文件名
#define VER_PRODUCTNAME_STR "K1160" //产品名称
#define VER_ORIGINALFILENAME_STR "QQT" //原始文件名
#define VER_PRODUCTNAME_STR "QQT" //产品名称
#define VER_COMPANYDOMAIN_STR "www.QQT.cc"
#define VER_COMPANYDOMAIN_STR "www.qqt.com"
#endif // QVERSION_H