--HG--
branch : develop
This commit is contained in:
dismine 2014-06-16 20:18:36 +03:00
parent 3e363aea81
commit 507ccd686e
23 changed files with 203 additions and 206 deletions

View File

@ -91,7 +91,7 @@ Calculator::Calculator(const QString &formula, bool fromUser)
SetVarFactory(AddVariable, this);
// Add unary operators
if(fromUser)
if (fromUser)
{
DefinePostfixOprt(qApp->PostfixOperator(cm_Oprt), CmUnit);
DefinePostfixOprt(qApp->PostfixOperator(mm_Oprt), MmUnit);
@ -292,7 +292,7 @@ void Calculator::InitCharacterSets()
qreal Calculator::CmUnit(qreal val)
{
qreal unit = val;
switch(qApp->patternUnit())
switch (qApp->patternUnit())
{
case Unit::Mm:
unit = val * 10.0;
@ -313,7 +313,7 @@ qreal Calculator::CmUnit(qreal val)
qreal Calculator::MmUnit(qreal val)
{
qreal unit = val;
switch(qApp->patternUnit())
switch (qApp->patternUnit())
{
case Unit::Mm:
break;
@ -334,7 +334,7 @@ qreal Calculator::MmUnit(qreal val)
qreal Calculator::InchUnit(qreal val)
{
qreal unit = val;
switch(qApp->patternUnit())
switch (qApp->patternUnit())
{
case Unit::Mm:
unit = val * 25.4;

View File

@ -1,73 +1,73 @@
/************************************************************************
**
** @file dialogaboutapp.cpp
** @author Patrick Proy <patrick(at)proy.org>
** @date 6 5, 2014
**
** @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.
**
** Valentina is free software: you can redistribute it and/or modify
** 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.
**
** Valentina is distributed in the hope that it will be useful,
** 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/>.
**
*************************************************************************/
#include "dialogaboutapp.h"
#include "ui_dialogaboutapp.h"
#include "../../version.h"
#include <QDate>
#include <QDesktopServices>
#include <QMessageBox>
//---------------------------------------------------------------------------------------------------------------------
DialogAboutApp::DialogAboutApp(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogAboutApp)
{
ui->setupUi(this);
ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION));
ui->label_QT_Version->setText(tr("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR));
QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
ui->label_Valentina_Built->setText(tr("Built on %3 at %4").arg(date.toString()).arg(__TIME__));
ui->label_Legal_Stuff->setText(WARRANTY);
ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
connect(ui->pushButton_Web_Site, &QPushButton::clicked, this, &DialogAboutApp::webButtonClicked );
}
//---------------------------------------------------------------------------------------------------------------------
DialogAboutApp::~DialogAboutApp()
{
delete ui;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Fake button clicked
*/
void DialogAboutApp::webButtonClicked()
{
if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false)
{
QMessageBox::warning(this, tr("Warning"), tr("Cannot open your default browser"));
}
}
/************************************************************************
**
** @file dialogaboutapp.cpp
** @author Patrick Proy <patrick(at)proy.org>
** @date 6 5, 2014
**
** @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.
**
** Valentina is free software: you can redistribute it and/or modify
** 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.
**
** Valentina is distributed in the hope that it will be useful,
** 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/>.
**
*************************************************************************/
#include "dialogaboutapp.h"
#include "ui_dialogaboutapp.h"
#include "../../version.h"
#include <QDate>
#include <QDesktopServices>
#include <QMessageBox>
//---------------------------------------------------------------------------------------------------------------------
DialogAboutApp::DialogAboutApp(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogAboutApp)
{
ui->setupUi(this);
ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION));
ui->label_QT_Version->setText(tr("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR));
QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
ui->label_Valentina_Built->setText(tr("Built on %3 at %4").arg(date.toString()).arg(__TIME__));
ui->label_Legal_Stuff->setText(WARRANTY);
ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
connect(ui->pushButton_Web_Site, &QPushButton::clicked, this, &DialogAboutApp::webButtonClicked );
}
//---------------------------------------------------------------------------------------------------------------------
DialogAboutApp::~DialogAboutApp()
{
delete ui;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Fake button clicked
*/
void DialogAboutApp::webButtonClicked()
{
if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false)
{
QMessageBox::warning(this, tr("Warning"), tr("Cannot open your default browser"));
}
}

View File

@ -1,55 +1,55 @@
/************************************************************************
**
** @file dialogaboutapp.h
** @author Patrick Proy <patrick(at)proy.org>
** @date 6 5, 2014
**
** @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.
**
** Valentina is free software: you can redistribute it and/or modify
** 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.
**
** Valentina is distributed in the hope that it will be useful,
** 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/>.
**
*************************************************************************/
#ifndef DIALOGABOUTAPP_H
#define DIALOGABOUTAPP_H
#include <QDialog>
namespace Ui
{
class DialogAboutApp;
}
class DialogAboutApp : public QDialog
{
Q_OBJECT
public:
explicit DialogAboutApp(QWidget *parent = 0);
~DialogAboutApp();
private:
Ui::DialogAboutApp *ui;
Q_DISABLE_COPY(DialogAboutApp)
private slots:
void webButtonClicked();
};
#endif // DIALOGABOUTAPP_H
/************************************************************************
**
** @file dialogaboutapp.h
** @author Patrick Proy <patrick(at)proy.org>
** @date 6 5, 2014
**
** @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.
**
** Valentina is free software: you can redistribute it and/or modify
** 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.
**
** Valentina is distributed in the hope that it will be useful,
** 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/>.
**
*************************************************************************/
#ifndef DIALOGABOUTAPP_H
#define DIALOGABOUTAPP_H
#include <QDialog>
namespace Ui
{
class DialogAboutApp;
}
class DialogAboutApp : public QDialog
{
Q_OBJECT
public:
explicit DialogAboutApp(QWidget *parent = 0);
~DialogAboutApp();
private:
Ui::DialogAboutApp *ui;
Q_DISABLE_COPY(DialogAboutApp)
private slots:
void webButtonClicked();
};
#endif // DIALOGABOUTAPP_H

View File

@ -106,7 +106,7 @@ bool DialogPatternXmlEdit::ApplyAttributeChange(QDomNode domElement, QString nam
{
return false;
}
domElement.toElement().setAttribute(name,value);
domElement.toElement().setAttribute(name, value);
return true;
}
@ -558,7 +558,7 @@ void DialogPatternXmlEdit::ButtonApplyChangesClicked()
currentChange=currentChange->next;
}
QString message;
if (this->CheckChanges(message,newroot) == false)
if (this->CheckChanges(message, newroot) == false)
{
QMessageBox::warning(this, "Error in changes", message);
return;
@ -719,8 +719,8 @@ void DialogPatternXmlEdit::ButtonAddSonClicked()
{
return;
}
QString value = QInputDialog::getText(this, tr("Node Value (may be empty)"),tr("Value:"),
QLineEdit::Normal,"", &ok);
QString value = QInputDialog::getText(this, tr("Node Value (may be empty)"), tr("Value:"),
QLineEdit::Normal, "", &ok);
if (ok==false)
{
return;

View File

@ -202,9 +202,9 @@ QGroupBox *ConfigurationPage::LangGroup()
QString checkedUnit = settings.value("configuration/unit", "cm").toString();
this->unitCombo->addItem(tr("Centimeters"),"cm");
this->unitCombo->addItem(tr("Milimiters"),"mm");
this->unitCombo->addItem(tr("Inches"),"in");
this->unitCombo->addItem(tr("Centimeters"), "cm");
this->unitCombo->addItem(tr("Milimiters"), "mm");
this->unitCombo->addItem(tr("Inches"), "in");
// set default unit
qint32 indexUnit = this->unitCombo->findData(checkedUnit);
@ -368,15 +368,15 @@ void CommunityPage::Apply()
QApplication::applicationName());
settings.setValue("community/server", this->server->text());
settings.setValue("community/serverSecure", this->secureComm->isChecked());
settings.setValue("community/useProxy",this->useProxy->isChecked());
settings.setValue("community/proxyAddress",this->proxyAddress->text());
settings.setValue("community/proxyPort",this->proxyPort->text());
settings.setValue("community/proxyUser",this->proxyUser->text());
settings.setValue("community/proxyPass",this->proxyPass->text());
settings.setValue("community/useProxy", this->useProxy->isChecked());
settings.setValue("community/proxyAddress", this->proxyAddress->text());
settings.setValue("community/proxyPort", this->proxyPort->text());
settings.setValue("community/proxyUser", this->proxyUser->text());
settings.setValue("community/proxyPass", this->proxyPass->text());
settings.setValue("community/username",this->username->text());
settings.setValue("community/savePassword",this->savePassword->isChecked());
settings.setValue("community/userpassword",this->userpassword->text());
settings.setValue("community/username", this->username->text());
settings.setValue("community/savePassword", this->savePassword->isChecked());
settings.setValue("community/userpassword", this->userpassword->text());
}
@ -414,10 +414,10 @@ QGroupBox *CommunityPage::ServerGroup()
QGroupBox *ServerGroup = new QGroupBox(tr("Server"));
QFormLayout *serverLayout = new QFormLayout;
CommunityPage::add_lineedit(&this->server,serverLayout,
CommunityPage::add_lineedit(&this->server, serverLayout,
settings.value("community/server", "community.valentina-project.org").toString(), tr("Server name/IP"));
CommunityPage::add_checkbox(&this->secureComm,serverLayout,
CommunityPage::add_checkbox(&this->secureComm, serverLayout,
settings.value("community/serverSecure", 0).toBool(), tr("Secure connection"));
ServerGroup->setLayout(serverLayout);

View File

@ -156,7 +156,7 @@ void DialogAlongLine::SaveData()
pointName = ui->lineEditNamePoint->text();
typeLine = GetTypeLine(ui->comboBoxLineType);
formula = ui->plainTextEditFormula->toPlainText();
formula.replace("\n"," ");
formula.replace("\n", " ");
firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint);
secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint);
}

View File

@ -195,7 +195,7 @@ void DialogArc::DialogApply()
void DialogArc::SaveData()
{
radius = ui->plainTextEditFormula->toPlainText();
radius.replace("\n"," ");
radius.replace("\n", " ");
f1 = ui->lineEditF1->text();
f2 = ui->lineEditF2->text();
center = getCurrentObjectId(ui->comboBoxBasePoint);

View File

@ -247,7 +247,7 @@ void DialogBisector::SaveData()
pointName = ui->lineEditNamePoint->text();
typeLine = GetTypeLine(ui->comboBoxLineType);
formula = ui->plainTextEditFormula->toPlainText();
formula.replace("\n"," ");
formula.replace("\n", " ");
firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint);
secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint);
thirdPointId = getCurrentObjectId(ui->comboBoxThirdPoint);

View File

@ -138,7 +138,7 @@ void DialogCutArc::SaveData()
{
pointName = ui->lineEditNamePoint->text();
formula = ui->plainTextEditFormula->toPlainText();
formula.replace("\n"," ");
formula.replace("\n", " ");
arcId = getCurrentObjectId(ui->comboBoxArc);
}

View File

@ -31,7 +31,8 @@
#include "dialogtool.h"
namespace Ui {
namespace Ui
{
class DialogEditWrongFormula;
}

View File

@ -94,7 +94,7 @@ void DialogEndLine::DeployFormulaTextEdit()
ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
//Set icon from theme (internal for Windows system)
ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
}
}
@ -201,7 +201,7 @@ void DialogEndLine::SaveData()
pointName = ui->lineEditNamePoint->text();
typeLine = GetTypeLine(ui->comboBoxLineType);
formula = ui->plainTextEditFormula->toPlainText();
formula.replace("\n"," ");
formula.replace("\n", " ");
angle = ui->doubleSpinBoxAngle->value();
basePointId = getCurrentObjectId(ui->comboBoxBasePoint);
}

View File

@ -153,7 +153,7 @@ void DialogNormal::SaveData()
pointName = ui->lineEditNamePoint->text();
typeLine = GetTypeLine(ui->comboBoxLineType);
formula = ui->plainTextEditFormula->toPlainText();
formula.replace("\n"," ");
formula.replace("\n", " ");
angle = ui->doubleSpinBoxAngle->value();
firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint);
secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint);

View File

@ -198,7 +198,7 @@ void DialogPointOfContact::SaveData()
{
pointName = ui->lineEditNamePoint->text();
radius = ui->plainTextEditFormula->toPlainText();
radius.replace("\n"," ");
radius.replace("\n", " ");
center = getCurrentObjectId(ui->comboBoxCenter);
firstPoint = getCurrentObjectId(ui->comboBoxFirstPoint);
secondPoint = getCurrentObjectId(ui->comboBoxSecondPoint);

View File

@ -176,7 +176,7 @@ void DialogShoulderPoint::SaveData()
pointName = ui->lineEditNamePoint->text();
typeLine = GetTypeLine(ui->comboBoxLineType);
formula = ui->plainTextEditFormula->toPlainText();
formula.replace("\n"," ");
formula.replace("\n", " ");
p1Line = getCurrentObjectId(ui->comboBoxP1Line);
p2Line = getCurrentObjectId(ui->comboBoxP2Line);
pShoulder = getCurrentObjectId(ui->comboBoxPShoulder);

View File

@ -467,7 +467,7 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76));
emit ToolTip("");
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
label->setText(tr("Error"));
flag = false;
@ -504,7 +504,7 @@ void DialogTool::Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *l
{
// Replace line return with spaces for calc
QString formula = edit->toPlainText();
formula.replace("\n"," ");
formula.replace("\n", " ");
formula = qApp->FormulaFromUser(formula);
Calculator *cal = new Calculator(data);
const qreal result = cal->EvalFormula(formula);
@ -528,7 +528,7 @@ void DialogTool::Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *l
palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76));
emit ToolTip("");
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
label->setText(tr("Error"));
flag = false;

View File

@ -379,7 +379,7 @@ void MainWindow::ApplyDialog()
void MainWindow::ToolEndLine(bool checked)
{
SetToolButtonWithApply<DialogEndLine>(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"),
&MainWindow::ClosedDialogEndLine,&MainWindow::ApplyDialogEndLine);
&MainWindow::ClosedDialogEndLine, &MainWindow::ApplyDialogEndLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -189,7 +189,7 @@ qreal VDrawTool::CheckFormula(QString &formula, VContainer *data)
result = cal->EvalFormula(formula);
delete cal;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
Q_UNUSED(e)
delete cal;

View File

@ -139,5 +139,3 @@ int SaveDetailOptions::id() const
{
return static_cast<int>(UndoCommand::SaveDetailOptions);
}

View File

@ -38,7 +38,8 @@ class SaveToolOptions : public QObject, public QUndoCommand
{
Q_OBJECT
public:
SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id, QUndoCommand *parent = 0);
SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id,
QUndoCommand *parent = 0);
virtual ~SaveToolOptions();
virtual void undo();
virtual void redo();

View File

@ -439,7 +439,7 @@ void VApplication::InitMeasurements()
"Full measurement description");
measurements.insert(acrossBackShoulderWidth_M, m);
guiTexts.insert(acrossBackShoulderWidth_M,g );
guiTexts.insert(acrossBackShoulderWidth_M, g );
descriptions.insert(acrossBackShoulderWidth_M, d);
//=================================================================================================================
m = VTranslation::translate("Measurements", "upper_back_width",
@ -1528,7 +1528,7 @@ bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const
QMap<QString, VTranslation>::const_iterator i = measurements.constBegin();
while (i != measurements.constEnd())
{
if(token == i.value().translate())
if (token == i.value().translate())
{
newFormula.replace(position, token.length(), i.key());
bias = token.length() - i.key().length();
@ -1545,7 +1545,7 @@ bool VApplication::VariablesFromUser(QString &newFormula, int position, const QS
QMap<QString, VTranslation>::const_iterator i = variables.constBegin();
while (i != variables.constEnd())
{
if(token.indexOf( i.value().translate() ) == 0)
if (token.indexOf( i.value().translate() ) == 0)
{
newFormula.replace(position, i.value().translate().length(), i.key());
QString newToken = token;
@ -1564,7 +1564,7 @@ bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, c
QMap<QString, VTranslation>::const_iterator i = postfixOperators.constBegin();
while (i != postfixOperators.constEnd())
{
if(token == i.value().translate())
if (token == i.value().translate())
{
newFormula.replace(position, token.length(), i.key());
bias = token.length() - i.key().length();
@ -1581,7 +1581,7 @@ bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QS
QMap<QString, VTranslation>::const_iterator i = functions.constBegin();
while (i != functions.constEnd())
{
if(token == i.value().translate())
if (token == i.value().translate())
{
newFormula.replace(position, token.length(), i.key());
bias = token.length() - i.key().length();
@ -1598,7 +1598,7 @@ bool VApplication::VariablesToUser(QString &newFormula, int position, const QStr
QMap<QString, VTranslation>::const_iterator i = variables.constBegin();
while (i != variables.constEnd())
{
if(token.indexOf( i.key() ) == 0)
if (token.indexOf( i.key() ) == 0)
{
newFormula.replace(position, i.key().length(), i.value().translate());
@ -1615,7 +1615,7 @@ bool VApplication::VariablesToUser(QString &newFormula, int position, const QStr
void VApplication::CorrectionsPositions(int position, int bias, QMap<int, QString> &tokens,
QMap<int, QString> &numbers)
{
if(bias == 0)
if (bias == 0)
{
return;
}
@ -1630,7 +1630,7 @@ void VApplication::BiasTokens(int position, int bias, QMap<int, QString> &tokens
QMap<int, QString>::const_iterator i = tokens.constBegin();
while (i != tokens.constEnd())
{
if(i.key()<= position)
if (i.key()<= position)
{
newTokens.insert(i.key(), i.value());
}
@ -1670,7 +1670,7 @@ QString VApplication::VarToUser(const QString &var) const
QString newVar = var;
int bias = 0;
if(VariablesToUser(newVar, 0, var, bias))
if (VariablesToUser(newVar, 0, var, bias))
{
return newVar;
}
@ -1682,22 +1682,22 @@ QString VApplication::VarFromUser(const QString &var) const
{
QString newVar = var;
int bias = 0;
if(MeasurementsFromUser(newVar, 0, var, bias))
if (MeasurementsFromUser(newVar, 0, var, bias))
{
return newVar;
}
if(VariablesFromUser(newVar, 0, var, bias))
if (VariablesFromUser(newVar, 0, var, bias))
{
return newVar;
}
if(PostfixOperatorsFromUser(newVar, 0, var, bias))
if (PostfixOperatorsFromUser(newVar, 0, var, bias))
{
return newVar;
}
if(FunctionsFromUser(newVar, 0, var, bias))
if (FunctionsFromUser(newVar, 0, var, bias))
{
return newVar;
}
@ -1737,7 +1737,7 @@ QString VApplication::FormulaFromUser(const QString &formula)
for (int i = 0; i < tKeys.size(); ++i)
{
int bias = 0;
if(MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
if (MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
{
if (bias != 0)
{
@ -1748,7 +1748,7 @@ QString VApplication::FormulaFromUser(const QString &formula)
continue;
}
if(VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
if (VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
{
if (bias != 0)
{
@ -1759,7 +1759,7 @@ QString VApplication::FormulaFromUser(const QString &formula)
continue;
}
if(PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
if (PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
{
if (bias != 0)
{
@ -1770,7 +1770,7 @@ QString VApplication::FormulaFromUser(const QString &formula)
continue;
}
if(FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
if (FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
{
if (bias != 0)
{
@ -1787,7 +1787,7 @@ QString VApplication::FormulaFromUser(const QString &formula)
bool osSeparatorValue = settings.value("configuration/osSeparator", 1).toBool();
QLocale loc = QLocale::system();
if(loc != QLocale(QLocale::C) && osSeparatorValue)
if (loc != QLocale(QLocale::C) && osSeparatorValue)
{
QList<int> nKeys = numbers.keys();
QList<QString> nValues = numbers.values();
@ -1889,7 +1889,7 @@ QString VApplication::FormulaToUser(const QString &formula)
}
int bias = 0;
if(VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias))
if (VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias))
{
if (bias != 0)
{
@ -1906,7 +1906,7 @@ QString VApplication::FormulaToUser(const QString &formula)
bool osSeparatorValue = settings.value("configuration/osSeparator", 1).toBool();
QLocale loc = QLocale::system();
if(loc != QLocale::C && osSeparatorValue)
if (loc != QLocale::C && osSeparatorValue)
{
QList<int> nKeys = numbers.keys();
QList<QString> nValues = numbers.values();
@ -1915,12 +1915,12 @@ QString VApplication::FormulaToUser(const QString &formula)
QLocale loc = QLocale(QLocale::C);
bool ok = false;
qreal d = loc.toDouble(nValues.at(i), &ok);
if(ok == false)
if (ok == false)
{
qDebug()<<"Can't convert to double token"<<nValues.at(i);
continue;
}
if(qFloor (d) < d)
if (qFloor (d) < d)
{
QLocale loc = QLocale::system();
QString dStr = loc.toString(d);

View File

@ -1031,7 +1031,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating point of end line"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1069,7 +1069,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating point along line"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1108,7 +1108,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating point of shoulder"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1147,7 +1147,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating point of normal"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1186,7 +1186,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating point of bisector"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1245,7 +1245,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating point of contact"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1364,7 +1364,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating cut spline point"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1399,7 +1399,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating cut spline path point"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1433,7 +1433,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating cut arc point"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1654,7 +1654,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen
excep.AddMoreInformation(e.ErrorMessage());
throw excep;
}
catch(qmu::QmuParserError &e)
catch (qmu::QmuParserError &e)
{
VExceptionObjectError excep(tr("Error creating or updating simple arc"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+
@ -1873,13 +1873,13 @@ void VPattern::GarbageCollector()
{
t.next();
VDataTool *tool = t.value();
if(tool->referens() <= 1)
if (tool->referens() <= 1)
{
QDomElement domElement = elementById(QString().setNum(t.key()));
if(domElement.isElement())
if (domElement.isElement())
{
QDomNode parent = domElement.parentNode();
if(parent.isNull() == false && parent.toElement().tagName() == TagModeling)
if (parent.isNull() == false && parent.toElement().tagName() == TagModeling)
{
parent.removeChild(domElement);
}

View File

@ -247,6 +247,4 @@ inline QStringList VPattern::getPatternPieces() const
return patternPieces;
}
#endif // VPATTERN_H

View File

@ -48,8 +48,7 @@ class QmuParserCallback
public:
QmuParserCallback(fun_type0 a_pFun, bool a_bAllowOpti);
QmuParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC);
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity)
;
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity);
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti);
QmuParserCallback(fun_type3 a_pFun, bool a_bAllowOpti);
QmuParserCallback(fun_type4 a_pFun, bool a_bAllowOpti);