From 90be3ad9de5bae8698d3cb0a22eca8a6bc6e387b Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Sat, 14 Jul 2018 17:07:53 +0430 Subject: [PATCH] qbs file fixed --- nut.qbs | 78 ++++++++++++++++++++++++++------------------ src/phrase.cpp | 8 ++--- src/tableset.h | 5 +-- test/common/consts.h | 6 ++++ 4 files changed, 59 insertions(+), 38 deletions(-) diff --git a/nut.qbs b/nut.qbs index d7e3dc1..f78c213 100644 --- a/nut.qbs +++ b/nut.qbs @@ -1,39 +1,53 @@ import qbs -Product { - type: "staticlibrary" - name: "nut" - Depends { name: 'cpp' } - Depends { name: "Qt.core" } - Depends { name: "Qt.sql" } +Project { +// StaticLibrary { +// name: "nut_static" +// files: [ +// "src/*.h", +// "src/*.cpp", +// "src/generators/*.h", +// "src/generators/*.cpp" +// ] +// Depends { name: 'cpp' } +// Depends { name: "Qt.core" } +// Depends { name: "Qt.sql" } +// Group { qbs.install: true; fileTagsFilter: product.type;} - Export { - Depends { name: "cpp" } +// Export { +// Depends { name: "cpp" } +// Depends { name: "Qt.core" } +// Depends { name: "Qt.sql" } +// cpp.includePaths: [ +// product.sourceDirectory + "/src", +// product.sourceDirectory + "/include" +// ] +// } +// } + + DynamicLibrary { + name: "nut" + files: [ + "src/*.h", + "src/*.cpp", + "src/generators/*.h", + "src/generators/*.cpp" + ] + + Depends { name: 'cpp' } Depends { name: "Qt.core" } Depends { name: "Qt.sql" } - cpp.includePaths: [ - product.sourceDirectory + "/src", - product.sourceDirectory + "/include" - ] - } - files: [ - "src/tableset.cpp", - "src/query.cpp", - "src/databasemodel.cpp", - "src/tablesetbase.cpp", - "src/changelogtable.cpp", - "src/querybase.cpp", - "src/tablemodel.cpp", - "src/wherephrase.cpp", - "src/table.cpp", - "src/database.cpp", - "src/generators/sqlgeneratorbase.cpp", - "src/generators/postgresqlgenerator.cpp", - "src/generators/mysqlgenerator.cpp", - "src/generators/sqlitegenerator.cpp", - "src/generators/sqlservergenerator.cpp", - "src/types/dbgeography.cpp", - "src/serializableobject.cpp" - ] + Group { qbs.install: true; fileTagsFilter: product.type;} + + Export { + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "Qt.sql" } + cpp.includePaths: [ + product.sourceDirectory + "/src", + product.sourceDirectory + "/include" + ] + } + } } diff --git a/src/phrase.cpp b/src/phrase.cpp index 4dba9b5..65b2691 100644 --- a/src/phrase.cpp +++ b/src/phrase.cpp @@ -477,7 +477,7 @@ ConditionalPhrase ConditionalPhrase::operator ==(const QVariant &other) // const_cast(other)); //} -#define DECLARE_CONDITIONALPHRASE_OPERATORS(op, cond) \ +#define DECLARE_CONDITIONALPHRASE_OPERATORS_IMPL(op, cond) \ ConditionalPhrase operator op(const ConditionalPhrase &l, \ const ConditionalPhrase &r) \ { \ @@ -526,9 +526,9 @@ ConditionalPhrase operator op(ConditionalPhrase &&l, ConditionalPhrase &&r) \ return p; \ } -DECLARE_CONDITIONALPHRASE_OPERATORS(==, PhraseData::Equal) -DECLARE_CONDITIONALPHRASE_OPERATORS(||, PhraseData::Or) -DECLARE_CONDITIONALPHRASE_OPERATORS(&&, PhraseData::And) +DECLARE_CONDITIONALPHRASE_OPERATORS_IMPL(==, PhraseData::Equal) +DECLARE_CONDITIONALPHRASE_OPERATORS_IMPL(||, PhraseData::Or) +DECLARE_CONDITIONALPHRASE_OPERATORS_IMPL(&&, PhraseData::And) ConditionalPhrase ConditionalPhrase::operator !() { diff --git a/src/tableset.h b/src/tableset.h index 8034a09..a6bfd2c 100644 --- a/src/tableset.h +++ b/src/tableset.h @@ -21,10 +21,10 @@ #ifndef TABLESET_H #define TABLESET_H -#include -#include +#include #include #include +#include #include #include "tablesetbase_p.h" @@ -52,6 +52,7 @@ public: int length() const; T *at(int i) const; const T &operator[](int i) const; + Query *query(); Query *query(bool autoDelete); }; diff --git a/test/common/consts.h b/test/common/consts.h index 75d7623..8078cde 100644 --- a/test/common/consts.h +++ b/test/common/consts.h @@ -1,6 +1,12 @@ #ifndef CONSTS_H #define CONSTS_H +#define PRINT(x) qDebug() << #x "=" << x; +#define TIC() QElapsedTimer timer; timer.start() +#define TOC() qDebug() << QString("Elapsed time: %1ms for %2") \ + .arg(timer.elapsed() / 1000.) \ + .arg(__func__) + //#define DRIVER "QPSQL" //#define HOST "127.0.0.1" //#define DATABASE "nutdb2"