mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 16:44:39 +03:00
Fix #51 4.6 build
This commit is contained in:
parent
d0091cb2f7
commit
46e89b8e9d
@ -30,6 +30,7 @@
|
|||||||
#include "lrbanddesignintf.h"
|
#include "lrbanddesignintf.h"
|
||||||
#include "lritemdesignintf.h"
|
#include "lritemdesignintf.h"
|
||||||
#include "lrglobal.h"
|
#include "lrglobal.h"
|
||||||
|
#include <algorithm>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include "lrdatasourcemanager.h"
|
|
||||||
#include "lrdatadesignintf.h"
|
#include "lrdatadesignintf.h"
|
||||||
#include "lrcollection.h"
|
#include "lrcollection.h"
|
||||||
#include "lrglobal.h"
|
#include "lrglobal.h"
|
||||||
|
@ -224,7 +224,7 @@ QScriptValue numberFormat(QScriptContext* pcontext, QScriptEngine* pengine){
|
|||||||
pengine->newVariant(QLocale(locale).toString(value.toDouble(),format,precision));
|
pengine->newVariant(QLocale(locale).toString(value.toDouble(),format,precision));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
#if QT_VERSION>0x040800
|
||||||
QScriptValue currencyFormat(QScriptContext* pcontext, QScriptEngine* pengine){
|
QScriptValue currencyFormat(QScriptContext* pcontext, QScriptEngine* pengine){
|
||||||
QVariant value = pcontext->argument(0).toVariant();
|
QVariant value = pcontext->argument(0).toVariant();
|
||||||
QString locale = (pcontext->argumentCount()>1)?pcontext->argument(1).toString():QLocale::system().name();
|
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);
|
if (CurrencySymbol!="") vTempStr.replace("$", CurrencySymbol);
|
||||||
return pengine->newVariant(vTempStr);
|
return pengine->newVariant(vTempStr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
QScriptValue dateFormat(QScriptContext* pcontext, QScriptEngine* pengine){
|
QScriptValue dateFormat(QScriptContext* pcontext, QScriptEngine* pengine){
|
||||||
QVariant value = pcontext->argument(0).toVariant();
|
QVariant value = pcontext->argument(0).toVariant();
|
||||||
QString format = (pcontext->argumentCount()>1)?pcontext->argument(1).toString().toLatin1():"dd.MM.yyyy";
|
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("dateTimeFormat", dateTimeFormat, "DATE&TIME", "dateTimeFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")");
|
||||||
addFunction("date",date,"DATE&TIME","date()");
|
addFunction("date",date,"DATE&TIME","date()");
|
||||||
addFunction("now",now,"DATE&TIME","now()");
|
addFunction("now",now,"DATE&TIME","now()");
|
||||||
|
#if QT_VERSION>0x040800
|
||||||
addFunction("currencyFormat",currencyFormat,"NUMBER","currencyFormat(\""+tr("Value")+"\",\""+tr("Locale")+"\")");
|
addFunction("currencyFormat",currencyFormat,"NUMBER","currencyFormat(\""+tr("Value")+"\",\""+tr("Locale")+"\")");
|
||||||
addFunction("currencyUSBasedFormat",currencyUSBasedFormat,"NUMBER","currencyUSBasedFormat(\""+tr("Value")+",\""+tr("CurrencySymbol")+"\")");
|
addFunction("currencyUSBasedFormat",currencyUSBasedFormat,"NUMBER","currencyUSBasedFormat(\""+tr("Value")+",\""+tr("CurrencySymbol")+"\")");
|
||||||
|
#endif
|
||||||
addFunction("setVariable", setVariable, "GENERAL", "setVariable(\""+tr("Name")+"\",\""+tr("Value")+"\")");
|
addFunction("setVariable", setVariable, "GENERAL", "setVariable(\""+tr("Name")+"\",\""+tr("Value")+"\")");
|
||||||
|
|
||||||
QScriptValue colorCtor = m_scriptEngine->newFunction(constructColor);
|
QScriptValue colorCtor = m_scriptEngine->newFunction(constructColor);
|
||||||
|
@ -179,7 +179,9 @@ void XmlFontSerializator::save(const QVariant &value, QString name)
|
|||||||
_node.setAttribute("Type","QFont");
|
_node.setAttribute("Type","QFont");
|
||||||
_node.setAttribute("family",font.family());
|
_node.setAttribute("family",font.family());
|
||||||
_node.setAttribute("pointSize",font.pointSize());
|
_node.setAttribute("pointSize",font.pointSize());
|
||||||
|
#if QT_VERSION>0x040800
|
||||||
_node.setAttribute("stylename",font.styleName());
|
_node.setAttribute("stylename",font.styleName());
|
||||||
|
#endif
|
||||||
_node.setAttribute("weight",font.weight());
|
_node.setAttribute("weight",font.weight());
|
||||||
//saveBool(_node,"bold",font.bold());
|
//saveBool(_node,"bold",font.bold());
|
||||||
saveBool(_node,"italic",font.italic());
|
saveBool(_node,"italic",font.italic());
|
||||||
@ -192,7 +194,9 @@ QVariant XmlFontSerializator::loadValue()
|
|||||||
QFont font;
|
QFont font;
|
||||||
font.setFamily(node()->attribute("family"));
|
font.setFamily(node()->attribute("family"));
|
||||||
font.setPointSize(node()->attribute("pointSize").toInt());
|
font.setPointSize(node()->attribute("pointSize").toInt());
|
||||||
|
#if QT_VERSION>0x040800
|
||||||
font.setStyleName(node()->attribute("stylename"));
|
font.setStyleName(node()->attribute("stylename"));
|
||||||
|
#endif
|
||||||
font.setWeight(node()->attribute("weight").toInt());
|
font.setWeight(node()->attribute("weight").toInt());
|
||||||
if (!node()->attribute("bold").isEmpty())
|
if (!node()->attribute("bold").isEmpty())
|
||||||
font.setBold(node()->attribute("bold").toInt());
|
font.setBold(node()->attribute("bold").toInt());
|
||||||
|
Loading…
Reference in New Issue
Block a user