From 01e36f3bbe398be5922685d5949e61dc31c4a4e3 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Thu, 22 Mar 2018 02:38:42 +0300 Subject: [PATCH] build without qtscriptengine fixed --- common.pri | 15 ++++++++++++--- limereport/items/lrtextitem.cpp | 2 ++ limereport/lrreportrender.cpp | 4 ++-- limereport/lrscriptenginemanager.cpp | 4 ++++ limereport/lrscriptenginemanager.h | 8 +++++--- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/common.pri b/common.pri index f224530..c39e56c 100644 --- a/common.pri +++ b/common.pri @@ -14,11 +14,19 @@ contains(CONFIG, easy_profiler){ DEFINES += BUILD_WITH_EASY_PROFILER } -!contains(CONFIG, qtscriptengine): -greaterThan(QT_MAJOR_VERSION, 4): +!contains(CONFIG, qtscriptengine){ +greaterThan(QT_MAJOR_VERSION, 4){ greaterThan(QT_MINOR_VERSION, 5){ CONFIG *= qjsengine } +} +} + +contains(CONFIG, qtscriptengine){ + CONFIG -= qjsengine + QT *= script + message(qtscriptengine) +} !contains(CONFIG, no_formdesigner){ CONFIG *= dialogdesigner @@ -93,7 +101,8 @@ LIMEREPORT_VERSION_RELEASE = 68 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" -QT *= script xml sql +QT *= xml sql + REPORT_PATH = $$PWD/limereport TRANSLATIONS_PATH = $$PWD/translations diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp index 9bd5b0e..4c0df76 100644 --- a/limereport/items/lrtextitem.cpp +++ b/limereport/items/lrtextitem.cpp @@ -29,7 +29,9 @@ ****************************************************************************/ #include #include +#ifndef USE_QJSENGINE #include +#endif #include #include #include diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 49c3dba..0d30ffc 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -253,7 +253,7 @@ void ReportRender::renderPage(PageItemDesignIntf* patternPage, bool isTOC, bool } #ifndef USE_QJSENGINE - Manager::instance().scriptEScriptEnginengine()->popContext(); + ScriptEngineManager::instance().scriptEngine()->popContext(); #endif } @@ -306,7 +306,7 @@ void ReportRender::initRenderPage() if (svCurrentPage.isValid()){ se->newQObject(svCurrentPage, m_renderPageItem); } else { - svThis = se->newQObject(m_renderPageItem); + svCurrentPage = se->newQObject(m_renderPageItem); se->globalObject().setProperty("currentPage", svCurrentPage); } #endif diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index 50ef677..d50de7e 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -31,7 +31,9 @@ #include #include +#ifndef USE_QJSENGINE #include +#endif #include #ifdef HAVE_UI_LOADER #include @@ -47,11 +49,13 @@ Q_DECLARE_METATYPE(QColor) Q_DECLARE_METATYPE(QFont) Q_DECLARE_METATYPE(LimeReport::ScriptEngineManager *) +#ifndef USE_QJSENGINE QScriptValue constructColor(QScriptContext *context, QScriptEngine *engine) { QColor color(context->argument(0).toString()); return engine->toScriptValue(color); } +#endif namespace LimeReport{ diff --git a/limereport/lrscriptenginemanager.h b/limereport/lrscriptenginemanager.h index c263b39..41d9b96 100644 --- a/limereport/lrscriptenginemanager.h +++ b/limereport/lrscriptenginemanager.h @@ -29,14 +29,15 @@ ****************************************************************************/ #ifndef LRSCRIPTENGINEMANAGER_H #define LRSCRIPTENGINEMANAGER_H - +#ifndef USE_QJSENGINE #include +#include +#endif #include #include #include #include #include -#include #include #include @@ -440,6 +441,7 @@ private: }; +#ifndef USE_QJSENGINE class QFontPrototype : public QObject, public QScriptable { Q_OBJECT Q_PROPERTY(QString family READ family) @@ -486,9 +488,9 @@ public: return qScriptValueFromValue(engine, font); } }; +#endif } - #ifndef USE_QJSENGINE Q_DECLARE_METATYPE(LimeReport::ComboBoxPrototype*) Q_DECLARE_METATYPE(QComboBox*)