This commit is contained in:
Hamed Masafi 2018-01-08 20:37:26 +03:30
parent 5394816999
commit 01614a2b3c
5 changed files with 7 additions and 7 deletions

View File

@ -81,10 +81,6 @@ public: \
private: \ private: \
NUT_WRAP_NAMESPACE(TableSet)<type*> *m_##n; \ NUT_WRAP_NAMESPACE(TableSet)<type*> *m_##n; \
public: \ public: \
static type *n##Table(){ \
static type *f = new type(); \
return f; \
} \
NUT_WRAP_NAMESPACE(TableSet)<type*> *n(){ \ NUT_WRAP_NAMESPACE(TableSet)<type*> *n(){ \
return m_##n; \ return m_##n; \
} }

View File

@ -1,6 +1,6 @@
#include "post.h"
#include "comment.h" #include "comment.h"
#include "tableset.h" #include "tableset.h"
#include "post.h"
Post::Post(QObject *parent) : Table(parent), Post::Post(QObject *parent) : Table(parent),
m_comments(new TableSet<Comment*>(this)), m_id(0), m_title("") m_comments(new TableSet<Comment*>(this)), m_id(0), m_title("")

View File

@ -4,13 +4,14 @@
#include <QtCore/qglobal.h> #include <QtCore/qglobal.h>
#include "table.h" #include "table.h"
#include "database.h" #include "database.h"
#include "comment.h" //#include "comment.h"
#include "databasemodel.h" #include "databasemodel.h"
#ifdef NUT_NAMESPACE #ifdef NUT_NAMESPACE
using namespace NUT_NAMESPACE; using namespace NUT_NAMESPACE;
#endif #endif
class Comment;
class Post : public Table class Post : public Table
{ {
Q_OBJECT Q_OBJECT

View File

@ -1,5 +1,7 @@
#include "user.h" #include "user.h"
#include "comment.h"
User::User(QObject *tableSet) : Table(tableSet), User::User(QObject *tableSet) : Table(tableSet),
m_comments(new TableSet<Comment*>(this)) m_comments(new TableSet<Comment*>(this))
{ {

View File

@ -4,12 +4,13 @@
#include <QtCore/QUuid> #include <QtCore/QUuid>
#include "table.h" #include "table.h"
#include "tableset.h" #include "tableset.h"
#include "comment.h" //#include "comment.h"
#ifdef NUT_NAMESPACE #ifdef NUT_NAMESPACE
using namespace NUT_NAMESPACE; using namespace NUT_NAMESPACE;
#endif #endif
class Comment;
class User : public Table class User : public Table
{ {
Q_OBJECT Q_OBJECT