From 46e89b8e9d5d383cc6d86fa9beeb5152d98b046d Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Mon, 3 Oct 2016 22:56:48 +0400 Subject: [PATCH] Fix #51 4.6 build --- limereport/lrbanddesignintf.cpp | 1 + limereport/lrdatasourcemanager.h | 1 - limereport/lrscriptenginemanager.cpp | 6 ++++-- limereport/serializators/lrxmlbasetypesserializators.cpp | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index 35c980c..a61230e 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -30,6 +30,7 @@ #include "lrbanddesignintf.h" #include "lritemdesignintf.h" #include "lrglobal.h" +#include #include #include diff --git a/limereport/lrdatasourcemanager.h b/limereport/lrdatasourcemanager.h index 97fe6d1..3e44687 100644 --- a/limereport/lrdatasourcemanager.h +++ b/limereport/lrdatasourcemanager.h @@ -32,7 +32,6 @@ #include #include -#include "lrdatasourcemanager.h" #include "lrdatadesignintf.h" #include "lrcollection.h" #include "lrglobal.h" diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index b9c2a61..f9c73db 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -224,7 +224,7 @@ QScriptValue numberFormat(QScriptContext* pcontext, QScriptEngine* pengine){ pengine->newVariant(QLocale(locale).toString(value.toDouble(),format,precision)); return res; } - +#if QT_VERSION>0x040800 QScriptValue currencyFormat(QScriptContext* pcontext, QScriptEngine* pengine){ QVariant value = pcontext->argument(0).toVariant(); QString locale = (pcontext->argumentCount()>1)?pcontext->argument(1).toString():QLocale::system().name(); @@ -240,7 +240,7 @@ QScriptValue currencyUSBasedFormat(QScriptContext* pcontext, QScriptEngine* peng if (CurrencySymbol!="") vTempStr.replace("$", CurrencySymbol); return pengine->newVariant(vTempStr); } - +#endif QScriptValue dateFormat(QScriptContext* pcontext, QScriptEngine* pengine){ QVariant value = pcontext->argument(0).toVariant(); QString format = (pcontext->argumentCount()>1)?pcontext->argument(1).toString().toLatin1():"dd.MM.yyyy"; @@ -416,8 +416,10 @@ ScriptEngineManager::ScriptEngineManager() addFunction("dateTimeFormat", dateTimeFormat, "DATE&TIME", "dateTimeFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")"); addFunction("date",date,"DATE&TIME","date()"); addFunction("now",now,"DATE&TIME","now()"); +#if QT_VERSION>0x040800 addFunction("currencyFormat",currencyFormat,"NUMBER","currencyFormat(\""+tr("Value")+"\",\""+tr("Locale")+"\")"); addFunction("currencyUSBasedFormat",currencyUSBasedFormat,"NUMBER","currencyUSBasedFormat(\""+tr("Value")+",\""+tr("CurrencySymbol")+"\")"); +#endif addFunction("setVariable", setVariable, "GENERAL", "setVariable(\""+tr("Name")+"\",\""+tr("Value")+"\")"); QScriptValue colorCtor = m_scriptEngine->newFunction(constructColor); diff --git a/limereport/serializators/lrxmlbasetypesserializators.cpp b/limereport/serializators/lrxmlbasetypesserializators.cpp index ac82079..dfdc208 100644 --- a/limereport/serializators/lrxmlbasetypesserializators.cpp +++ b/limereport/serializators/lrxmlbasetypesserializators.cpp @@ -179,7 +179,9 @@ void XmlFontSerializator::save(const QVariant &value, QString name) _node.setAttribute("Type","QFont"); _node.setAttribute("family",font.family()); _node.setAttribute("pointSize",font.pointSize()); +#if QT_VERSION>0x040800 _node.setAttribute("stylename",font.styleName()); +#endif _node.setAttribute("weight",font.weight()); //saveBool(_node,"bold",font.bold()); saveBool(_node,"italic",font.italic()); @@ -192,7 +194,9 @@ QVariant XmlFontSerializator::loadValue() QFont font; font.setFamily(node()->attribute("family")); font.setPointSize(node()->attribute("pointSize").toInt()); +#if QT_VERSION>0x040800 font.setStyleName(node()->attribute("stylename")); +#endif font.setWeight(node()->attribute("weight").toInt()); if (!node()->attribute("bold").isEmpty()) font.setBold(node()->attribute("bold").toInt());