This commit is contained in:
Hamed Masafi 2018-03-11 16:43:13 +03:30
parent 9f712a55ea
commit 244778eb50
6 changed files with 13 additions and 5 deletions

View File

@ -34,7 +34,7 @@ struct FieldModel;
class DatabaseModel;
class TableModel;
class Database;
class RelationModel;
struct RelationModel;
class SqlGeneratorBase : public QObject
{
// Q_OBJECT

View File

@ -280,9 +280,10 @@ PhraseList::~PhraseList()
LOG("");
}
PhraseList &PhraseList::operator =(const PhraseData &other)
PhraseList &PhraseList::operator =(const PhraseList &other)
{
return other;
data.append(const_cast<PhraseList&>(other).data);
return *this;
}
PhraseList PhraseList::operator |(const AbstractFieldPhrase &other) {

View File

@ -182,7 +182,7 @@ public:
PhraseList(PhraseList *left, const AbstractFieldPhrase *right);
virtual ~PhraseList();
PhraseList &operator =(const PhraseData &other);
PhraseList &operator =(const PhraseList &other);
PhraseList operator |(PhraseList &other);
PhraseList operator |(const AbstractFieldPhrase &other);

View File

@ -31,7 +31,7 @@ NUT_BEGIN_NAMESPACE
class Database;
class TableSetBase;
class QueryBase;
class RelationModel;
struct RelationModel;
class QueryPrivate{
QueryBase *q_ptr;
Q_DECLARE_PUBLIC(QueryBase)

View File

@ -324,6 +324,12 @@ TableModel::TableModel(QJsonObject json, QString tableName)
_allModels.insert(this);
}
TableModel::~TableModel()
{
qDeleteAll(_fields);
qDeleteAll(_foreignKeys);
}
QJsonObject TableModel::toJson() const
{
QJsonObject obj;

View File

@ -94,6 +94,7 @@ class TableModel
public:
explicit TableModel(int typeId, QString tableName = QString::null);
explicit TableModel(QJsonObject json, QString tableName);
virtual ~TableModel();
QJsonObject toJson() const;