mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
move QQtObjectParcel to QQtObjectManager
This commit is contained in:
parent
f3243f204d
commit
149a49a406
@ -40,7 +40,9 @@ LibQQt现进行正式发布版本v2.1.6.0,欢迎工程师们使用。
|
||||
6. 解决Qt4.8.7在嵌入式屏幕上QGraphics系统不正常绘画的问题
|
||||
7. QQt输入法
|
||||
- 重写了UI,适配多种屏幕
|
||||
8. Qt对象工厂,允许注册、生成、查找和删除所有来自QObject以及QWidget的类。
|
||||
8. Qt对象管理器
|
||||
- 用于管理已经生成的Qt对象实例,objectName是唯一查找索引。
|
||||
- 含有QQtObjectFactory,用于动态注册、生成来自QObject和QWidget的类。
|
||||
9. 嵌入式视频播放器,模拟端口实时预览器
|
||||
0. QQt打印机,支持打印pdf
|
||||
2. QQtWord,支持doc文档编写,输出pdf格式。
|
||||
|
@ -16,12 +16,12 @@ AnimationManager* AnimationManager::Instance(QObject* parent)
|
||||
AnimationManager::AnimationManager(QObject* parent) : QObject(parent)
|
||||
{
|
||||
//init app's all animation
|
||||
QPushButton* pushButton = (QPushButton*)QQtObjectParcel::registeredObject("pushButton");
|
||||
QPushButton* pushButton_2 = (QPushButton*)QQtObjectParcel::registeredObject("pushButton_2");
|
||||
QPushButton* pushButton_3 = (QPushButton*)QQtObjectParcel::registeredObject("pushButton_3");
|
||||
QPushButton* pushButton_4 = (QPushButton*)QQtObjectParcel::registeredObject("pushButton_4");
|
||||
QPushButton* pushButton_5 = (QPushButton*)QQtObjectParcel::registeredObject("pushButton_5");
|
||||
QPushButton* pushButton_6 = (QPushButton*)QQtObjectParcel::registeredObject("pushButton_6");
|
||||
QPushButton* pushButton = (QPushButton*)QQtObjectManager::registeredObject("pushButton");
|
||||
QPushButton* pushButton_2 = (QPushButton*)QQtObjectManager::registeredObject("pushButton_2");
|
||||
QPushButton* pushButton_3 = (QPushButton*)QQtObjectManager::registeredObject("pushButton_3");
|
||||
QPushButton* pushButton_4 = (QPushButton*)QQtObjectManager::registeredObject("pushButton_4");
|
||||
QPushButton* pushButton_5 = (QPushButton*)QQtObjectManager::registeredObject("pushButton_5");
|
||||
QPushButton* pushButton_6 = (QPushButton*)QQtObjectManager::registeredObject("pushButton_6");
|
||||
|
||||
QQtAnimation* ani = new QQtAnimation(this);
|
||||
QSequentialAnimationGroup* sa = new QSequentialAnimationGroup(ani);
|
||||
|
@ -14,7 +14,7 @@ QQTWindow::QQTWindow(QWidget* parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QQtObjectParcel::registerObject(this);
|
||||
QQtObjectManager::registerObject(this);
|
||||
|
||||
#ifdef __EMBEDDED_LINUX__
|
||||
/*
|
||||
@ -29,12 +29,12 @@ QQTWindow::QQTWindow(QWidget* parent) :
|
||||
setFixedSize(1024, 600);
|
||||
moveCenter(this);
|
||||
|
||||
QQtObjectParcel::registerObject(ui->pushButton);
|
||||
QQtObjectParcel::registerObject(ui->pushButton_2);
|
||||
QQtObjectParcel::registerObject(ui->pushButton_3);
|
||||
QQtObjectParcel::registerObject(ui->pushButton_4);
|
||||
QQtObjectParcel::registerObject(ui->pushButton_5);
|
||||
QQtObjectParcel::registerObject(ui->pushButton_6);
|
||||
QQtObjectManager::registerObject(ui->pushButton);
|
||||
QQtObjectManager::registerObject(ui->pushButton_2);
|
||||
QQtObjectManager::registerObject(ui->pushButton_3);
|
||||
QQtObjectManager::registerObject(ui->pushButton_4);
|
||||
QQtObjectManager::registerObject(ui->pushButton_5);
|
||||
QQtObjectManager::registerObject(ui->pushButton_6);
|
||||
|
||||
/**
|
||||
* @brief QQtAnimationManager::Instance
|
||||
|
@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QQtObjectParcel::registerObject(this);
|
||||
QQtObjectManager::registerObject(this);
|
||||
|
||||
#ifdef __EMBEDDED_LINUX__
|
||||
/*
|
||||
|
@ -1 +0,0 @@
|
||||
#include "qqtobjectfactory.h"
|
1
src/core/qqtobjectmanager.cpp
Normal file
1
src/core/qqtobjectmanager.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "qqtobjectmanager.h"
|
@ -1,5 +1,5 @@
|
||||
#ifndef QQTOBJECTFACTORY_H
|
||||
#define QQTOBJECTFACTORY_H
|
||||
#ifndef QQTOBJECTMANAGER_H
|
||||
#define QQTOBJECTMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QByteArray>
|
||||
@ -122,10 +122,12 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The QQtObjectParcel class
|
||||
* QQt 对象管理器 工厂模式
|
||||
* @brief The QQtObjectManager class
|
||||
* QQt 对象管理器
|
||||
* 用于管理Qt对象实例。
|
||||
* 曾用名 QQtObjectParcel
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtObjectParcel
|
||||
class QQTSHARED_EXPORT QQtObjectManager
|
||||
{
|
||||
public:
|
||||
/**
|
||||
@ -295,4 +297,4 @@ private:
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // QQTOBJECTFACTORY_H
|
||||
#endif // QQTOBJECTMANAGER_H
|
@ -33,8 +33,8 @@ QQtProgressDialog::QQtProgressDialog(QWidget* parent) :
|
||||
"./skin/default/bk_progress_chunk.png");
|
||||
#endif
|
||||
|
||||
QQtObjectParcel::registerObject(this);
|
||||
QQtObjectParcel::registerObject(ui->btnCancel);
|
||||
QQtObjectManager::registerObject(this);
|
||||
QQtObjectManager::registerObject(ui->btnCancel);
|
||||
}
|
||||
|
||||
QQtProgressDialog::~QQtProgressDialog()
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include "qqt-local.h"
|
||||
#include "qqtcore.h"
|
||||
|
||||
/**
|
||||
* @brief The QQtTcpServer class
|
||||
* 这个类相当于QQtTcpClient管理器,相当于Socket管理器,它包含很多Socket。
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtTcpServer : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -134,22 +134,22 @@ void QQtTcpClient::socketStateChanged ( QAbstractSocket::SocketState eSocketStat
|
||||
|
||||
switch ( eSocketState )
|
||||
{
|
||||
case QAbstractSocket::HostLookupState:
|
||||
case QAbstractSocket::ConnectingState:
|
||||
break;
|
||||
case QAbstractSocket::HostLookupState:
|
||||
case QAbstractSocket::ConnectingState:
|
||||
break;
|
||||
|
||||
case QAbstractSocket::ConnectedState:
|
||||
break;
|
||||
case QAbstractSocket::ConnectedState:
|
||||
break;
|
||||
|
||||
case QAbstractSocket::ClosingState:
|
||||
break;
|
||||
case QAbstractSocket::ClosingState:
|
||||
break;
|
||||
|
||||
case QAbstractSocket::UnconnectedState:
|
||||
eConType++;
|
||||
break;
|
||||
case QAbstractSocket::UnconnectedState:
|
||||
eConType++;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,13 +167,13 @@ void QQtTcpClient::socketErrorOccured ( QAbstractSocket::SocketError e )
|
||||
|
||||
switch ( e )
|
||||
{
|
||||
case QAbstractSocket::RemoteHostClosedError:
|
||||
break;
|
||||
case QAbstractSocket::RemoteHostClosedError:
|
||||
break;
|
||||
|
||||
case QAbstractSocket::HostNotFoundError:
|
||||
default:
|
||||
emit signalConnectFail();
|
||||
break;
|
||||
case QAbstractSocket::HostNotFoundError:
|
||||
default:
|
||||
emit signalConnectFail();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,6 +217,7 @@ void QQtTcpClient::connectToSingelHost()
|
||||
|
||||
void QQtTcpClient::readyReadData()
|
||||
{
|
||||
//self, protocol, message
|
||||
QByteArray bytes;
|
||||
bytes = readAll();
|
||||
m_protocol->translator ( bytes );
|
||||
|
@ -41,11 +41,11 @@ contains (QKIT_PRIVATE, WIN32||WIN64) {
|
||||
SOURCES += \
|
||||
$$PWD/core/qqtcore.cpp \
|
||||
$$PWD/core/qqtdictionary.cpp \
|
||||
$$PWD/core/qqtobjectfactory.cpp
|
||||
$$PWD/core/qqtobjectmanager.cpp
|
||||
HEADERS += \
|
||||
$$PWD/core/qqtcore.h \
|
||||
$$PWD/core/qqtdictionary.h \
|
||||
$$PWD/core/qqtobjectfactory.h
|
||||
$$PWD/core/qqtobjectmanager.h
|
||||
|
||||
#后台进程支持,这个只有ios不支持,这个支持在源文件pri里处理。
|
||||
DEFINES += __PROCESSMODULE__
|
||||
|
@ -19,7 +19,7 @@ int main ( int argc, char* argv[] )
|
||||
pline() << obj->inherits ( "QObject" );
|
||||
obj->setObjectName ( "bbb" );
|
||||
pline() << obj->objectName();
|
||||
QQtObjectParcel::registerObject ( obj );
|
||||
QQtObjectManager::registerObject ( obj );
|
||||
*/
|
||||
|
||||
//对QQtDictNode的使用进行测试。
|
||||
|
@ -11,7 +11,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QQtObjectParcel::registerObject(this);
|
||||
QQtObjectManager::registerObject(this);
|
||||
|
||||
#ifdef __EMBEDDED_LINUX__
|
||||
/*
|
||||
|
@ -25,7 +25,7 @@ AnimationManager::AnimationManager(QObject *parent) : QObject(parent)
|
||||
* user can't decate qqtwindow
|
||||
*/
|
||||
QQTWindow* qqtwindow = (QQTWindow*)
|
||||
QQtObjectParcel::registeredObject("QQTWindow");
|
||||
QQtObjectManager::registeredObject("QQTWindow");
|
||||
QQtAnimation* ani = new QQtAnimation(this);
|
||||
QSequentialAnimationGroup* sani = new QSequentialAnimationGroup(ani);
|
||||
QParallelAnimationGroup* pani = new QParallelAnimationGroup(ani);
|
||||
|
@ -22,7 +22,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QQtObjectParcel::registerObject(this);
|
||||
QQtObjectManager::registerObject(this);
|
||||
|
||||
#ifdef __EMBEDDED_LINUX__
|
||||
/*
|
||||
|
@ -17,7 +17,7 @@ QQTWindow::QQTWindow(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QQtObjectParcel::registerObject(this);
|
||||
QQtObjectManager::registerObject(this);
|
||||
|
||||
#ifdef __EMBEDDED_LINUX__
|
||||
/*
|
||||
|
@ -13,7 +13,7 @@ QQTWindow::QQTWindow ( QWidget* parent ) :
|
||||
{
|
||||
ui->setupUi ( this );
|
||||
|
||||
QQtObjectParcel::registerObject ( this );
|
||||
QQtObjectManager::registerObject ( this );
|
||||
|
||||
#ifdef __EMBEDDED_LINUX__
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user