0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-23 16:22:58 +03:00

Merge branch 'master' into 1.4

This commit is contained in:
Arin Alexander 2016-10-03 22:56:58 +04:00
commit e4457787f5
4 changed files with 9 additions and 3 deletions

View File

@ -30,6 +30,7 @@
#include "lrbanddesignintf.h"
#include "lritemdesignintf.h"
#include "lrglobal.h"
#include <algorithm>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>

View File

@ -32,7 +32,6 @@
#include <QObject>
#include <QIcon>
#include "lrdatasourcemanager.h"
#include "lrdatadesignintf.h"
#include "lrcollection.h"
#include "lrglobal.h"

View File

@ -229,7 +229,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();
@ -245,7 +245,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";
@ -426,8 +426,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);

View File

@ -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());