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

fix c++ synax error

This commit is contained in:
tianduanrui 2018-04-23 22:57:16 +08:00
parent c271628777
commit e9636f8f5d
2 changed files with 10 additions and 2 deletions

View File

@ -1 +1 @@
#include "qqtobjectmanager.h"
#include "qqtobjectmanager.h"

View File

@ -1,4 +1,4 @@
#ifndef QQTOBJECTMANAGER_H
#ifndef QQTOBJECTMANAGER_H
#define QQTOBJECTMANAGER_H
#include <QObject>
@ -58,6 +58,8 @@ private:
static QHash<QString, Constructor>& constructors() {
/*
*
*
* 使
*/
static QHash<QString, Constructor> instance;
return instance;
@ -135,6 +137,8 @@ public:
* @param w
*/
static void registerObject ( const QObject* const& w ) {
if ( !containers().contains ( w ) )
return;
containers().push_back ( w );
}
/**
@ -173,6 +177,10 @@ public:
}
private:
//包裹一下,有利于省却全局声明。
//强调这个static不论是否被静态成员函数包裹永远存在。
//类不决定生存周期。
//类决定作用域。
static QList<const QObject*>& containers() {
static QList<const QObject*> instance;
return instance;