2013-11-15 13:41:26 +01:00
|
|
|
|
/************************************************************************
|
2013-09-23 14:08:06 +02:00
|
|
|
|
**
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @file vapplication.cpp
|
2014-04-30 07:38:52 +02:00
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @date November 15, 2013
|
2013-09-23 14:08:06 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
|
** Copyright (C) 2013 Valentina project
|
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
2013-09-23 14:08:06 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-23 14:08:06 +02:00
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-23 14:08:06 +02:00
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
*************************************************************************/
|
2013-09-23 14:08:06 +02:00
|
|
|
|
|
|
|
|
|
#include "vapplication.h"
|
2013-11-06 18:06:00 +01:00
|
|
|
|
#include "../exception/vexceptionobjecterror.h"
|
|
|
|
|
#include "../exception/vexceptionbadid.h"
|
|
|
|
|
#include "../exception/vexceptionconversionerror.h"
|
|
|
|
|
#include "../exception/vexceptionemptyparameter.h"
|
2014-03-03 18:32:38 +01:00
|
|
|
|
#include "../exception/vexceptionwrongid.h"
|
2013-09-23 14:08:06 +02:00
|
|
|
|
|
2013-11-21 13:05:26 +01:00
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
#include <QDebug>
|
2014-05-12 11:35:33 +02:00
|
|
|
|
#include <QDir>
|
2013-11-21 13:05:26 +01:00
|
|
|
|
|
2014-05-23 20:11:13 +02:00
|
|
|
|
#include <container/calculator.h>
|
|
|
|
|
|
2014-03-19 19:27:11 +01:00
|
|
|
|
const qreal VApplication::PrintDPI = 96.0;
|
|
|
|
|
|
2014-03-26 05:39:07 +01:00
|
|
|
|
#define DefWidth 1.2//mm
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-19 19:27:11 +01:00
|
|
|
|
VApplication::VApplication(int &argc, char **argv)
|
2014-03-26 05:39:07 +01:00
|
|
|
|
: QApplication(argc, argv), _patternUnit(Valentina::Cm), _patternType(Pattern::Individual),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
_widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), measurements(QMap<QString, VTranslation>()),
|
2014-05-16 12:00:33 +02:00
|
|
|
|
guiTexts(QMap<QString, VTranslation>()), descriptions(QMap<QString, VTranslation>()),
|
2014-05-23 09:14:21 +02:00
|
|
|
|
variables(QMap<QString, VTranslation>()), functions(QMap<QString, VTranslation>()),
|
|
|
|
|
postfixOperators(QMap<QString, VTranslation>())
|
2014-03-19 19:27:11 +01:00
|
|
|
|
{
|
2014-03-26 05:39:07 +01:00
|
|
|
|
InitLineWidth();
|
2014-05-13 10:08:37 +02:00
|
|
|
|
InitMeasurements();
|
|
|
|
|
InitVariables();
|
|
|
|
|
InitFunctions();
|
2014-05-23 09:14:21 +02:00
|
|
|
|
InitPostfixOperators();
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-26 05:39:07 +01:00
|
|
|
|
// reimplemented from QApplication so we can throw exceptions in slots
|
2013-11-04 21:35:15 +01:00
|
|
|
|
bool VApplication::notify(QObject *receiver, QEvent *event)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2014-03-19 19:27:11 +01:00
|
|
|
|
return QApplication::notify(receiver, event);
|
2013-09-23 14:08:06 +02:00
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionObjectError &e)
|
|
|
|
|
{
|
2014-03-03 16:42:14 +01:00
|
|
|
|
e.CriticalMessageBox(tr("Error parsing file. Program will be terminated."));
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionBadId &e)
|
|
|
|
|
{
|
2014-03-03 16:42:14 +01:00
|
|
|
|
e.CriticalMessageBox(tr("Error bad id. Program will be terminated."));
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionConversionError &e)
|
|
|
|
|
{
|
2014-03-03 16:42:14 +01:00
|
|
|
|
e.CriticalMessageBox(tr("Error can't convert value. Program will be terminated."));
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionEmptyParameter &e)
|
|
|
|
|
{
|
2014-03-03 16:42:14 +01:00
|
|
|
|
e.CriticalMessageBox(tr("Error empty parameter. Program will be terminated."));
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2014-03-03 18:32:38 +01:00
|
|
|
|
catch (const VExceptionWrongId &e)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2014-03-03 16:42:14 +01:00
|
|
|
|
e.CriticalMessageBox(tr("Error wrong id. Program will be terminated."));
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VException &e)
|
|
|
|
|
{
|
2014-03-03 16:42:14 +01:00
|
|
|
|
e.CriticalMessageBox(tr("Something's wrong!!"));
|
|
|
|
|
return true;
|
2013-10-10 20:45:58 +02:00
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (std::exception& e)
|
|
|
|
|
{
|
2013-09-23 14:08:06 +02:00
|
|
|
|
qCritical() << "Exception thrown:" << e.what();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2014-03-19 19:27:11 +01:00
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-19 19:27:11 +01:00
|
|
|
|
double VApplication::toPixel(double unit) const
|
|
|
|
|
{
|
|
|
|
|
double result = 0;
|
|
|
|
|
switch (_patternUnit)
|
|
|
|
|
{
|
|
|
|
|
case Valentina::Mm:
|
|
|
|
|
result = (unit / 25.4) * PrintDPI;
|
|
|
|
|
break;
|
|
|
|
|
case Valentina::Cm:
|
|
|
|
|
result = ((unit * 10.0) / 25.4) * PrintDPI;
|
|
|
|
|
break;
|
2014-03-24 16:02:57 +01:00
|
|
|
|
case Valentina::Inch:
|
2014-03-19 19:27:11 +01:00
|
|
|
|
result = unit * PrintDPI;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-19 19:27:11 +01:00
|
|
|
|
double VApplication::fromPixel(double pix) const
|
|
|
|
|
{
|
|
|
|
|
double result = 0;
|
|
|
|
|
switch (_patternUnit)
|
|
|
|
|
{
|
|
|
|
|
case Valentina::Mm:
|
|
|
|
|
result = (pix / PrintDPI) * 25.4;
|
|
|
|
|
break;
|
|
|
|
|
case Valentina::Cm:
|
|
|
|
|
result = ((pix / PrintDPI) * 25.4) / 10.0;
|
|
|
|
|
break;
|
2014-03-24 16:02:57 +01:00
|
|
|
|
case Valentina::Inch:
|
2014-03-19 19:27:11 +01:00
|
|
|
|
result = pix / PrintDPI;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2014-05-02 13:11:30 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-19 19:27:11 +01:00
|
|
|
|
QString VApplication::pathToTables() const
|
|
|
|
|
{
|
|
|
|
|
if (_patternType == Pattern::Individual)
|
|
|
|
|
{
|
2014-05-15 11:47:08 +02:00
|
|
|
|
return QStringLiteral("://tables/individual/individual.vit");
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
#ifdef Q_OS_WIN
|
2014-03-23 15:36:34 +01:00
|
|
|
|
return QApplication::applicationDirPath() + QStringLiteral("/tables/standard");
|
2014-03-19 19:27:11 +01:00
|
|
|
|
#else
|
|
|
|
|
#ifdef QT_DEBUG
|
2014-03-23 15:36:34 +01:00
|
|
|
|
return QApplication::applicationDirPath() + QStringLiteral("/tables/standard");
|
2014-03-19 19:27:11 +01:00
|
|
|
|
#else
|
2014-05-12 11:35:33 +02:00
|
|
|
|
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/tables/standard"));
|
|
|
|
|
if(dir.exist())
|
|
|
|
|
{
|
|
|
|
|
return dir.absolutePath();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return QStringLiteral("/usr/share/valentina/tables/standard");
|
|
|
|
|
}
|
2014-03-19 19:27:11 +01:00
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-19 19:27:11 +01:00
|
|
|
|
QString VApplication::translationsPath() const
|
|
|
|
|
{
|
2014-03-26 05:39:07 +01:00
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
|
return QApplication::applicationDirPath() + QStringLiteral("/translations");
|
|
|
|
|
#else
|
|
|
|
|
#ifdef QT_DEBUG
|
|
|
|
|
return QApplication::applicationDirPath() + QStringLiteral("/translations");
|
2014-05-12 11:35:33 +02:00
|
|
|
|
#else
|
|
|
|
|
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/translations"));
|
|
|
|
|
if(dir.exist())
|
|
|
|
|
{
|
|
|
|
|
return dir.absolutePath();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-03-19 19:27:11 +01:00
|
|
|
|
return QStringLiteral("/usr/share/valentina/translations");
|
2014-05-12 11:35:33 +02:00
|
|
|
|
}
|
2014-03-19 19:27:11 +01:00
|
|
|
|
#endif
|
2014-05-12 11:35:33 +02:00
|
|
|
|
#endif
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
2014-03-26 05:39:07 +01:00
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-26 05:39:07 +01:00
|
|
|
|
void VApplication::InitLineWidth()
|
|
|
|
|
{
|
2014-05-01 13:33:40 +02:00
|
|
|
|
switch (_patternUnit)
|
2014-03-26 05:39:07 +01:00
|
|
|
|
{
|
|
|
|
|
case Valentina::Mm:
|
|
|
|
|
_widthMainLine = DefWidth;
|
|
|
|
|
break;
|
|
|
|
|
case Valentina::Cm:
|
|
|
|
|
_widthMainLine = DefWidth/10.0;
|
|
|
|
|
break;
|
|
|
|
|
case Valentina::Inch:
|
|
|
|
|
_widthMainLine = DefWidth/25.4;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
_widthMainLine = DefWidth;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_widthHairLine = _widthMainLine/3.0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-13 10:08:37 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::InitMeasurements()
|
|
|
|
|
{
|
|
|
|
|
// head_and_neck
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(headGirth_M, QStringLiteral("Head girth"), QStringLiteral("Around fullest part of Head"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(midNeckGirth_M, QStringLiteral("Mid-neck girth"), QStringLiteral("Around middle part of Neck"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckBaseGirth_M, QStringLiteral("Neck Base girth"), QStringLiteral("Around Neck at base"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(headAndNeckLength_M, QStringLiteral("Head and Neck length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Vertical Distance from Crown to Nape"));
|
|
|
|
|
|
|
|
|
|
// torso
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(centerFrontWaistLength_M, QStringLiteral("Front Center length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Front Neck Center over tape at Bustline to Front Waist Center"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(centerBackWaistLength_M, QStringLiteral("Back Center length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Back Neck Center to Back Waist Center"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(shoulderLength_M, QStringLiteral("Shoulder length"), QStringLiteral("NeckPoint to ShoulderTip"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(sideWaistLength_M, QStringLiteral("Side Waist length"), QStringLiteral("Armpit to Waist side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(trunkLength_M, QStringLiteral("Trunk length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Around Body from middle of Shoulder length to BustPoint to Crotch up back to beginning point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(shoulderGirth_M, QStringLiteral("Shoulder girth"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Around Arms and Torso, at bicep level parallel to floor, with arms hanging at the sides"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(upperChestGirth_M, QStringLiteral("Upper Chest girth"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Around Chest at Armfold level, will be parallel to floor across back, will not be parallel to floor"
|
|
|
|
|
" across front chest"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(bustGirth_M, QStringLiteral("Bust girth"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Around fullest part of Bust, parallel to floor"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(underBustGirth_M, QStringLiteral("Under Bust girth"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Around Chest below the Bust, parallel to floor"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(waistGirth_M, QStringLiteral("Waist girth"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Tie a string around smallest part of waist, keep string tied while taking meaasurements. Not"
|
|
|
|
|
" usually parallel to floor for front waist or back waist."));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(highHipGirth_M, QStringLiteral("HighHip girth"), QStringLiteral("Around HighHip, parallel to floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(hipGirth_M, QStringLiteral("Hip girth"), QStringLiteral("Around Hip, parallel to floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(upperFrontChestWidth_M, QStringLiteral("Front Upper Chest width"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Across Front UpperChest, smallest width from armscye to armscye"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontChestWidth_M, QStringLiteral("Front Chest width"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Across Front Chest, from armfold to armfold"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(acrossFrontShoulderWidth_M, QStringLiteral("Front Across Shoulder width"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("From ShoulderTip to ShoulderTip, across Front"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(acrossBackShoulderWidth_M, QStringLiteral("Back Across Shoulder width"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("From ShoulderTip to ShoulderTip, across Back"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(acrossBackShoulderWidth_M, QStringLiteral("Back Upper Chest width"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Across Back UpperChest, smallest width from armscye to armscye"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backWidth_M, QStringLiteral("Back Chest width"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Across Back Chest, from armfold to armfold"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(bustpointToBustpoint_M, QStringLiteral("BustPoint to BustPoint"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Distance between BustPoints, across Chest"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halterBustpointToBustpoint_M, QStringLiteral("Halter Bustpoint to Bustpoint"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Distance from Bustpoint, behind neck, down to Bustpoint"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToBustpoint_M, QStringLiteral("NeckPoint to BustPoint"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("From NeckPoint to BustPoint"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(crotchLength_M, QStringLiteral("Crotch length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("From Front Waist Center, down to crotch, up to Back Waist Center"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(riseHeight_M, QStringLiteral("Rise height"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Sit on hard chair, measure from side waist straight down to chair bottom"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(shoulderDrop_M, QStringLiteral("Shoulder Drop"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Vertical Distance from NeckPoint level to ShoulderTip level"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(shoulderSlopeDegrees_M, QStringLiteral("Shoulder Slope degrees"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Degrees of angle from NeckPoint to ShoulderTip – requires goniometer"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontShoulderSlopeLength_M, QStringLiteral("Front Shoulder Balance"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("ShoulderTip to Front Waist Center"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backShoulderSlopeLength_M, QStringLiteral("Back Shoulder Balance"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("ShoulderTip to Back Waist Center"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontShoulderToWaistLength_M, QStringLiteral("Front Full Length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("NeckPoint straight down front chest to Waistline"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backShoulderToWaistLength_M, QStringLiteral("Back Full Length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Back NeckPoint straight down back chest to Waistline"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontNeckArc_M, QStringLiteral("Front Neck arc"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("NeckPoint to NeckPoint through Front Neck Center"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backNeckArc_M, QStringLiteral("Back Neck arc"), QStringLiteral("NeckPoint to NeckPoint across Nape"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontUpperChestArc_M, QStringLiteral("front_upper-bust_arc"), QStringLiteral("front_upper-bust_arc"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backUpperChestArc_M, QStringLiteral("Back UpperBust arc"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Back UpperBust side to side"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontWaistArc_M, QStringLiteral("Front Waist arc"), QStringLiteral("Front Waist side to side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backWaistArc_M, QStringLiteral("Back Waist arc"), QStringLiteral("Back Waist side to side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontUpperHipArc_M, QStringLiteral("Front UpperHip arc"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Front UpperHip side to side"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backUpperHipArc_M, QStringLiteral("Back UpperHip arc"), QStringLiteral("Back UpperHip side to side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontHipArc_M, QStringLiteral("Front Hip arc"), QStringLiteral("Front Hip side to side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backHipArc_M, QStringLiteral("Back Hip arc"), QStringLiteral("Back Hip side to side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(chestSlope_M, QStringLiteral("Chest Balance"), QStringLiteral("NeckPoint to Front ArmfoldPoint"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backSlope_M, QStringLiteral("Back Balance"), QStringLiteral("NeckPoint to Back ArmfoldPoint"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontWaistSlope_M, QStringLiteral("Front Waist Balance"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("NeckPoint across Front Chest to Waist side"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(backWaistSlope_M, QStringLiteral("Back Waist Balance"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("NeckPoint across Back Chest to Waist side"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontNeckToUpperChestHeight_M, QStringLiteral("Front UpperChest height"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Front Neck Center straight down to UpperChest line"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontNeckToBustHeight_M, QStringLiteral("Bust height"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Front Neck Center straight down to Bust line"));
|
|
|
|
|
|
|
|
|
|
// arm
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(armscyeGirth_M, QStringLiteral("Armscye Girth"), QStringLiteral("Around Armscye"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(elbowGirth_M, QStringLiteral("Elbow Girth"), QStringLiteral("Around Elbow with elbow bent"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(upperArmGirth_M, QStringLiteral("Upperarm Girth"), QStringLiteral("Around UpperArm"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(wristGirth_M, QStringLiteral("Wrist girth"), QStringLiteral("Around Wrist"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(scyeDepth_M, QStringLiteral("Armscye depth"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Nape straight down to UnderBust line (same as Back UpperBust height)"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(shoulderAndArmLength_M, QStringLiteral("Shoulder and Arm length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("NeckPoint to ShoulderTip to Wrist, with elbow bent and hand on hip"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(underarmLength_M, QStringLiteral("Underarm length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Armpit to Wrist, with arm straight and hanging at side"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(cervicaleToWristLength_M, QStringLiteral("Nape to wrist length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Nape to Wrist, with elbow bent and hand on hip"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(shoulderToElbowLength_M, QStringLiteral("Elbow length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("ShoulderTip to Elbow, with elbow bent and hand on hip"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(armLength_M, QStringLiteral("Arm length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("ShoulderTip to Wrist, with elbow bent and hand on hip"));
|
|
|
|
|
|
|
|
|
|
// hand
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(handWidth_M, QStringLiteral("Hand width"), QStringLiteral("Hand side to side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(handLength_M, QStringLiteral("Hand length"), QStringLiteral("Hand Middle Finger tip to wrist"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(handGirth_M, QStringLiteral("Hand girth"), QStringLiteral("Around Hand"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
|
|
|
|
// leg
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(thighGirth_M, QStringLiteral("Thigh girth"), QStringLiteral("Around Thigh"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(midThighGirth_M, QStringLiteral("Midthigh girth"), QStringLiteral("Around MidThigh"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(kneeGirth_M, QStringLiteral("Knee girth"), QStringLiteral("Around Knee"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(calfGirth_M, QStringLiteral("Calf girth"), QStringLiteral("Around Calf"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(ankleGirth_M, QStringLiteral("Ankle girth"), QStringLiteral("Around Ankle"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(kneeHeight_M, QStringLiteral("Knee height"), QStringLiteral("Knee to Floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(ankleHeight_M, QStringLiteral("Ankle height"), QStringLiteral("Ankle to Floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
|
|
|
|
// foot
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(footWidth_M, QStringLiteral("Foot width"), QStringLiteral("Widest part of Foot side to side"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(footLength_M, QStringLiteral("Foot length"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Tip of Longest Toe straight to back of heel"));
|
|
|
|
|
|
|
|
|
|
// heights
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(height_M, QStringLiteral("Total Height"), QStringLiteral("Top of head to floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(cervicaleHeight_M, QStringLiteral("Nape height"), QStringLiteral("Nape to Floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(cervicaleToKneeHeight_M, QStringLiteral("Nape to knee height"), QStringLiteral("Nape to Knee"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(waistHeight_M, QStringLiteral("Waist height"), QStringLiteral("Waist side to floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(highHipHeight_M, QStringLiteral("HighHip height"), QStringLiteral("HighHip side to Floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(hipHeight_M, QStringLiteral("Hip height"), QStringLiteral("Hip side to Floor"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(waistToHipHeight_M, QStringLiteral("Waist to Hip height"), QStringLiteral("Waist side to Hip"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(waistToKneeHeight_M, QStringLiteral("Waist to Knee height"), QStringLiteral("Waist side to Knee"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(crotchHeight_M, QStringLiteral("Crotch height/Inseam"),
|
2014-05-13 10:08:37 +02:00
|
|
|
|
QStringLiteral("Crotch to Floor along inside leg"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
//extended
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightFrontNeckBasePoint_M, QStringLiteral("Height front neck base point"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Height of the point base of the neck in front"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightBaseNeckSidePoint_M, QStringLiteral("Height base neck side point"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Height of the base of the neck side point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightShoulderPoint_M, QStringLiteral("Height shoulder point"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The height of the shoulder point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightNipplePoint_M, QStringLiteral("Height nipple point"), QStringLiteral("Height nipple point"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightBackAngleAxilla_M, QStringLiteral("Height back angle axilla"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Height back angle axilla"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightScapularPoint_M, QStringLiteral("Height scapular point"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Height scapular point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightUnderButtockFolds_M, QStringLiteral("Height under buttock folds"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Height under buttock folds"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(hipsExcludingProtrudingAbdomen_M, QStringLiteral("Hips excluding protruding abdomen"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Hips excluding protruding abdomen"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(girthFootInstep_M, QStringLiteral("Girth foot instep"), QStringLiteral("Girth foot instep"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(sideWaistToFloor_M, QStringLiteral("Side waist to floor"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the side waist to floor"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontWaistToFloor_M, QStringLiteral("Front waist to floor"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the front waist to floor"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(arcThroughGroinArea_M, QStringLiteral("Arc through groin area"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Arc through groin area"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(waistToPlaneSeat_M, QStringLiteral("Waist to plane seat"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the waist to the plane seat"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToRadialPoint_M, QStringLiteral("Neck to radial point"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the base of the neck to the side of the radial point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToThirdFinger_M, QStringLiteral("Neck to third finger"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Distance from the base of the neck side point to the end of the third finger"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToFirstLineChestCircumference_M, QStringLiteral("Neck to first line chest circumference"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the base of the neck to the side of the first line in front of "
|
|
|
|
|
"chest circumference"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontWaistLength_M, QStringLiteral("Front waist length"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the base of the neck to the waist side front (waist length in "
|
|
|
|
|
"the front)"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(arcThroughShoulderJoint_M, QStringLiteral("Arc through shoulder joint"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Arc through the highest point of the shoulder joint"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToBackLineChestCircumference_M, QStringLiteral("Neck to back line chest circumference"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the base of the neck to the back line of chest circumference of "
|
|
|
|
|
"the first and the second based on ledge vanes"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(waistToNeckSide_M, QStringLiteral("Waist to neck side"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the waist to the back base of the neck side point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(arcLengthUpperBody_M, QStringLiteral("Arc length upper body"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Arc length of the upper body through the base of the neck side point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(chestWidth_M, QStringLiteral("Chest width"), QStringLiteral("Chest width"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(anteroposteriorDiameterHands_M, QStringLiteral("Anteroposterior diameter hands"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Anteroposterior diameter of the hands"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightClavicularPoint_M, QStringLiteral("Height clavicular point"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Height clavicular point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(heightArmholeSlash_M, QStringLiteral("Height armhole slash"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the point to the cervical level of the posterior angle of the "
|
|
|
|
|
"front armpit (underarm height oblique)"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(slashShoulderHeight_M, QStringLiteral("Slash shoulder height"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Slash shoulder height"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthNeck_M, QStringLiteral("Half girth neck"), QStringLiteral("Half girth neck"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthNeckForShirts_M, QStringLiteral("Half girth neck for shirts"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Half girth neck for shirts"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthChestFirst_M, QStringLiteral("Half girth chest first"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Half girth chest first"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthChestSecond_M, QStringLiteral("Half girth chest second"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Half girth chest second"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthChestThird_M, QStringLiteral("Half girth chest third"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Half girth chest third"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthWaist_M, QStringLiteral("Half girth waist"), QStringLiteral("Half girth waist"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthHipsConsideringProtrudingAbdomen_M,
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Half girth hips considering protruding abdomen"),
|
|
|
|
|
QStringLiteral("Half girth hips considering protruding abdomen"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(halfGirthHipsExcludingProtrudingAbdomen_M,
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Half girth hips excluding protruding abdomen"),
|
|
|
|
|
QStringLiteral("Half girth hips excluding protruding abdomen"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(girthKneeFlexedFeet_M, QStringLiteral("Girth knee flexed feet"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Girth knee flexed feet"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckTransverseDiameter_M, QStringLiteral("Neck transverse diameter"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Neck transverse diameter"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(frontSlashShoulderHeight_M, QStringLiteral("Front slash shoulder height"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Front slash shoulder height"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToFrontWaistLine_M, QStringLiteral("Neck to front waist line"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the base of the neck to the waist line front"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(handVerticalDiameter_M, QStringLiteral("Hand vertical diameter"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Hand vertical diameter"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToKneePoint_M, QStringLiteral("Neck to knee point"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Distance from neck to knee point"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(waistToKnee_M, QStringLiteral("Waist to knee"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("The distance from the waist to the knee"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(shoulderHeight_M, QStringLiteral("Shoulder height"), QStringLiteral("Shoulder height"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(headHeight_M, QStringLiteral("Head height"), QStringLiteral("Head height"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(bodyPosition_M, QStringLiteral("Body position"), QStringLiteral("Body position"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(arcBehindShoulderGirdle_M, QStringLiteral("Arc behind shoulder girdle"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Arc behind the shoulder girdle"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(neckToNeckBase_M, QStringLiteral("Neck to neck base"),
|
2014-05-15 15:18:31 +02:00
|
|
|
|
QStringLiteral("Distance from neck point to point on the base of the neck side neck girth "
|
|
|
|
|
"measurement line"));
|
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(depthWaistFirst_M, QStringLiteral("Depth waist first"), QStringLiteral("Depth waist first"));
|
2014-05-15 15:18:31 +02:00
|
|
|
|
|
2014-05-16 13:17:25 +02:00
|
|
|
|
InitMeasurement(depthWaistSecond_M, QStringLiteral("Depth waist second"), QStringLiteral("Depth waist second"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-05-16 12:00:33 +02:00
|
|
|
|
void VApplication::InitMeasurement(const QString &measurement, const QString &guiText, const QString &desc)
|
2014-05-13 10:08:37 +02:00
|
|
|
|
{
|
|
|
|
|
const QString context = QStringLiteral("Measurements");
|
|
|
|
|
const QString disambiguation1 = QStringLiteral("Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
const QString disambiguation2 = QStringLiteral("Full measurement name");
|
|
|
|
|
const QString disambiguation3 = QStringLiteral("Full measurement description");
|
|
|
|
|
|
|
|
|
|
measurements.insert(measurement, VTranslation::translate(context, measurement, disambiguation1));
|
2014-05-16 12:00:33 +02:00
|
|
|
|
guiTexts.insert(measurement, VTranslation::translate(context, guiText, disambiguation2));
|
|
|
|
|
descriptions.insert(measurement, VTranslation::translate(context, desc, disambiguation3));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::InitVariables()
|
|
|
|
|
{
|
|
|
|
|
const QString context = QStringLiteral("Variables");
|
|
|
|
|
const QString disambiguation = QStringLiteral("Left symbol _ in name");
|
|
|
|
|
|
|
|
|
|
variables.insert(line_, VTranslation::translate(context, line_, disambiguation));
|
|
|
|
|
variables.insert(angleLine_, VTranslation::translate(context, angleLine_, disambiguation));
|
|
|
|
|
variables.insert(arc_, VTranslation::translate(context, arc_, disambiguation));
|
|
|
|
|
variables.insert(spl_, VTranslation::translate(context, spl_, disambiguation));
|
|
|
|
|
variables.insert(splPath, VTranslation::translate(context, splPath, disambiguation));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::InitFunctions()
|
|
|
|
|
{
|
|
|
|
|
const QString context = QStringLiteral("Functions");
|
|
|
|
|
|
|
|
|
|
functions.insert(sin_F, VTranslation::translate(context, sin_F, QStringLiteral("sine function")));
|
|
|
|
|
functions.insert(cos_F, VTranslation::translate(context, cos_F, QStringLiteral("cosine function")));
|
|
|
|
|
functions.insert(tan_F, VTranslation::translate(context, tan_F, QStringLiteral("tangens function")));
|
|
|
|
|
functions.insert(asin_F, VTranslation::translate(context, asin_F, QStringLiteral("arcus sine function")));
|
|
|
|
|
functions.insert(acos_F, VTranslation::translate(context, acos_F, QStringLiteral("arcus cosine function")));
|
|
|
|
|
functions.insert(atan_F, VTranslation::translate(context, atan_F, QStringLiteral("arcus tangens function")));
|
|
|
|
|
functions.insert(sinh_F, VTranslation::translate(context, sinh_F, QStringLiteral("hyperbolic sine function")));
|
|
|
|
|
functions.insert(cosh_F, VTranslation::translate(context, cosh_F, QStringLiteral("hyperbolic cosine")));
|
|
|
|
|
functions.insert(tanh_F, VTranslation::translate(context, tanh_F, QStringLiteral("hyperbolic tangens function")));
|
|
|
|
|
functions.insert(asinh_F, VTranslation::translate(context, asinh_F,
|
|
|
|
|
QStringLiteral("hyperbolic arcus sine function")));
|
|
|
|
|
functions.insert(acosh_F, VTranslation::translate(context, acosh_F,
|
|
|
|
|
QStringLiteral("hyperbolic arcus tangens function")));
|
|
|
|
|
functions.insert(atanh_F, VTranslation::translate(context, atanh_F,
|
|
|
|
|
QStringLiteral("hyperbolic arcur tangens function")));
|
|
|
|
|
functions.insert(log2_F, VTranslation::translate(context, log2_F, QStringLiteral("logarithm to the base 2")));
|
|
|
|
|
functions.insert(log10_F, VTranslation::translate(context, log10_F, QStringLiteral("logarithm to the base 10")));
|
|
|
|
|
functions.insert(log_F, VTranslation::translate(context, log_F, QStringLiteral("logarithm to the base 10")));
|
|
|
|
|
functions.insert(ln_F, VTranslation::translate(context, ln_F, QStringLiteral("logarithm to base e (2.71828...)")));
|
|
|
|
|
functions.insert(exp_F, VTranslation::translate(context, exp_F, QStringLiteral("e raised to the power of x")));
|
|
|
|
|
functions.insert(sqrt_F, VTranslation::translate(context, sqrt_F, QStringLiteral("square root of a value")));
|
|
|
|
|
functions.insert(sign_F, VTranslation::translate(context, sign_F,
|
|
|
|
|
QStringLiteral("sign function -1 if x<0; 1 if x>0")));
|
|
|
|
|
functions.insert(rint_F, VTranslation::translate(context, rint_F, QStringLiteral("round to nearest integer")));
|
|
|
|
|
functions.insert(abs_F, VTranslation::translate(context, abs_F, QStringLiteral("absolute value")));
|
|
|
|
|
functions.insert(min_F, VTranslation::translate(context, min_F, QStringLiteral("min of all arguments")));
|
|
|
|
|
functions.insert(max_F, VTranslation::translate(context, max_F, QStringLiteral("max of all arguments")));
|
|
|
|
|
functions.insert(sum_F, VTranslation::translate(context, sum_F, QStringLiteral("sum of all arguments")));
|
|
|
|
|
functions.insert(avg_F, VTranslation::translate(context, avg_F, QStringLiteral("mean value of all arguments")));
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-23 20:11:13 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-05-23 09:14:21 +02:00
|
|
|
|
void VApplication::InitPostfixOperators()
|
|
|
|
|
{
|
|
|
|
|
const QString context = QStringLiteral("PostfixOperators");
|
|
|
|
|
|
|
|
|
|
postfixOperators.insert(cm_Oprt, VTranslation::translate(context, cm_Oprt, QStringLiteral("centimeter")));
|
|
|
|
|
postfixOperators.insert(mm_Oprt, VTranslation::translate(context, mm_Oprt, QStringLiteral("millimeter")));
|
|
|
|
|
postfixOperators.insert(in_Oprt, VTranslation::translate(context, in_Oprt, QStringLiteral("inch")));
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-23 20:11:13 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VApplication::Measurements(QString &newFormula, int position, const QString &token)
|
|
|
|
|
{
|
|
|
|
|
QMap<QString, VTranslation>::const_iterator i = measurements.constBegin();
|
|
|
|
|
while (i != measurements.constEnd())
|
|
|
|
|
{
|
|
|
|
|
if(token == i.value().translate())
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, token.length(), i.key());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VApplication::VariablesFromUser(QString &newFormula, int position, const QString &token)
|
|
|
|
|
{
|
|
|
|
|
QMap<QString, VTranslation>::const_iterator i = variables.constBegin();
|
|
|
|
|
while (i != variables.constEnd())
|
|
|
|
|
{
|
|
|
|
|
if(token.indexOf( i.value().translate() ) == 0)
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, i.value().translate().length(), i.key());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VApplication::PostfixOperators(QString &newFormula, int position, const QString &token)
|
|
|
|
|
{
|
|
|
|
|
QMap<QString, VTranslation>::const_iterator i = postfixOperators.constBegin();
|
|
|
|
|
while (i != postfixOperators.constEnd())
|
|
|
|
|
{
|
|
|
|
|
if(token == i.value().translate())
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, token.length(), i.key());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VApplication::Functions(QString &newFormula, int position, const QString &token)
|
|
|
|
|
{
|
|
|
|
|
QMap<QString, VTranslation>::const_iterator i = functions.constBegin();
|
|
|
|
|
while (i != functions.constEnd())
|
|
|
|
|
{
|
|
|
|
|
if(token == i.value().translate())
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, token.length(), i.key());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VApplication::VariablesToUser(QString &newFormula, int position, const QString &token)
|
|
|
|
|
{
|
|
|
|
|
QMap<QString, VTranslation>::const_iterator i = variables.constBegin();
|
|
|
|
|
while (i != variables.constEnd())
|
|
|
|
|
{
|
|
|
|
|
if(token.indexOf( i.key() ) == 0)
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, variables.value(i.key()).translate().length(), i.value().translate());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-26 05:39:07 +01:00
|
|
|
|
void VApplication::setPatternUnit(const Valentina::Units &patternUnit)
|
|
|
|
|
{
|
|
|
|
|
_patternUnit = patternUnit;
|
|
|
|
|
InitLineWidth();
|
|
|
|
|
}
|
2014-05-16 12:00:33 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::Measurement(const QString &measurement) const
|
|
|
|
|
{
|
|
|
|
|
return measurements.value(measurement).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::GuiText(const QString &measurement) const
|
|
|
|
|
{
|
|
|
|
|
return guiTexts.value(measurement).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::Description(const QString &measurement) const
|
|
|
|
|
{
|
|
|
|
|
return descriptions.value(measurement).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::Variable(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
return variables.value(name).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::Function(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
return functions.value(name).translate();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::PostfixOperator(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
return postfixOperators.value(name).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::FormulaFromUser(const QString &formula)
|
|
|
|
|
{
|
|
|
|
|
QString newFormula = formula;
|
|
|
|
|
|
|
|
|
|
QMap<int, QString> tokens;
|
|
|
|
|
QMap<int, QString> numbers;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Calculator cal(formula);
|
|
|
|
|
tokens = cal.GetTokens();
|
|
|
|
|
numbers = cal.GetNumbers();
|
|
|
|
|
}
|
|
|
|
|
catch(qmu::QmuParserError &e)
|
|
|
|
|
{
|
|
|
|
|
qDebug() << "\nMath parser error:\n"
|
|
|
|
|
<< "--------------------------------------\n"
|
|
|
|
|
<< "Message: " << e.GetMsg() << "\n"
|
|
|
|
|
<< "Expression: " << e.GetExpr() << "\n"
|
|
|
|
|
<< "--------------------------------------";
|
|
|
|
|
return newFormula;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QMap<int, QString>::const_iterator i = tokens.constBegin();
|
|
|
|
|
while (i != tokens.constEnd())
|
|
|
|
|
{
|
|
|
|
|
if(Measurements(newFormula, i.key(), i.value()))
|
|
|
|
|
{
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(VariablesFromUser(newFormula, i.key(), i.value()))
|
|
|
|
|
{
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(PostfixOperators(newFormula, i.key(), i.value()))
|
|
|
|
|
{
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(Functions(newFormula, i.key(), i.value()))
|
|
|
|
|
{
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QLocale loc = QLocale();
|
|
|
|
|
if(loc != QLocale(QLocale::C))
|
|
|
|
|
{
|
|
|
|
|
QMap<int, QString>::const_iterator i = numbers.constBegin();
|
|
|
|
|
while (i != numbers.constEnd())
|
|
|
|
|
{
|
|
|
|
|
QLocale::setDefault(QLocale::C);
|
|
|
|
|
bool ok = false;
|
|
|
|
|
qreal d = QString(i.value()).toDouble(&ok);
|
|
|
|
|
if(ok == false)
|
|
|
|
|
{
|
|
|
|
|
qDebug()<<"Can't convert to double token"<<i.value();
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(qFloor (d) < d)
|
|
|
|
|
{
|
|
|
|
|
QLocale::setDefault(QLocale::system());
|
|
|
|
|
QLocale loc = QLocale();
|
|
|
|
|
QString dStr = loc.toString(d);
|
|
|
|
|
newFormula.replace(i.key(), i.value().length(), dStr);
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newFormula;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::FormulaToUser(const QString &formula)
|
|
|
|
|
{
|
|
|
|
|
QString newFormula = formula;
|
|
|
|
|
|
|
|
|
|
QMap<int, QString> tokens;
|
|
|
|
|
QMap<int, QString> numbers;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Calculator cal(formula);
|
|
|
|
|
tokens = cal.GetTokens();
|
|
|
|
|
numbers = cal.GetNumbers();
|
|
|
|
|
}
|
|
|
|
|
catch (qmu::QmuParserError &e)
|
|
|
|
|
{
|
|
|
|
|
qDebug() << "\nMath parser error:\n"
|
|
|
|
|
<< "--------------------------------------\n"
|
|
|
|
|
<< "Message: " << e.GetMsg() << "\n"
|
|
|
|
|
<< "Expression: " << e.GetExpr() << "\n"
|
|
|
|
|
<< "--------------------------------------";
|
|
|
|
|
return newFormula;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QMap<int, QString>::const_iterator i = tokens.constBegin();
|
|
|
|
|
while (i != tokens.constEnd())
|
|
|
|
|
{
|
|
|
|
|
if (measurements.contains(i.value()))
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(i.key(), i.value().length(), measurements.value(i.value()).translate());
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (functions.contains(i.value()))
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(i.key(), i.value().length(), functions.value(i.value()).translate());
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (postfixOperators.contains(i.value()))
|
|
|
|
|
{
|
|
|
|
|
newFormula.replace(i.key(), i.value().length(), postfixOperators.value(i.value()).translate());
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(VariablesToUser(newFormula, i.key(), i.value()))
|
|
|
|
|
{
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QLocale loc = QLocale();
|
|
|
|
|
if(loc != QLocale::C)
|
|
|
|
|
{
|
|
|
|
|
QMap<int, QString>::const_iterator i = numbers.constBegin();
|
|
|
|
|
while (i != numbers.constEnd())
|
|
|
|
|
{
|
|
|
|
|
bool ok = false;
|
|
|
|
|
qreal d = QString(i.value()).toDouble(&ok);
|
|
|
|
|
if(ok == false)
|
|
|
|
|
{
|
|
|
|
|
qDebug()<<"Can't convert to double token"<<i.value();
|
|
|
|
|
++i;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(qFloor (d) < d)
|
|
|
|
|
{
|
|
|
|
|
QLocale::setDefault(QLocale::C);
|
|
|
|
|
QLocale loc = QLocale();
|
|
|
|
|
QString dStr = loc.toString(d);
|
|
|
|
|
newFormula.replace(i.key(), i.value().length(), dStr);
|
|
|
|
|
QLocale::setDefault(QLocale::system());
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newFormula;
|
|
|
|
|
}
|