mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
添加动画控制器
This commit is contained in:
parent
f6e589cd9f
commit
6dc209169f
6
qqtanimation.cpp
Normal file
6
qqtanimation.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "qqtanimation.h"
|
||||
|
||||
QQTAnimation::QQTAnimation(QObject *parent) : QParallelAnimationGroup(parent)
|
||||
{
|
||||
|
||||
}
|
22
qqtanimation.h
Normal file
22
qqtanimation.h
Normal 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
15
qqtanimationmanager.cpp
Normal 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
30
qqtanimationmanager.h
Normal 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
|
@ -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 \
|
||||
|
18
qqtgui-qt.h
18
qqtgui-qt.h
@ -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
|
||||
|
@ -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()
|
||||
{
|
||||
|
12
version.h
12
version.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user