After change language method StrToUnits wrong convert unit from string.
--HG-- branch : develop
This commit is contained in:
parent
64ea04b44f
commit
1762cb42b8
|
@ -248,7 +248,7 @@ void DialogIndividualMeasurements::InitUnits()
|
||||||
{
|
{
|
||||||
ui->comboBoxUnits->addItem(tr("Centimeters"), QVariant(VDomDocument::UnitsToStr(Unit::Cm)));
|
ui->comboBoxUnits->addItem(tr("Centimeters"), QVariant(VDomDocument::UnitsToStr(Unit::Cm)));
|
||||||
ui->comboBoxUnits->addItem(tr("Milimiters"), QVariant(VDomDocument::UnitsToStr(Unit::Mm)));
|
ui->comboBoxUnits->addItem(tr("Milimiters"), QVariant(VDomDocument::UnitsToStr(Unit::Mm)));
|
||||||
ui->comboBoxUnits->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch, true)));
|
ui->comboBoxUnits->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch)));
|
||||||
|
|
||||||
const QString checkedUnit = qApp->getSettings()->value("configuration/unit", "cm").toString();
|
const QString checkedUnit = qApp->getSettings()->value("configuration/unit", "cm").toString();
|
||||||
// set default unit
|
// set default unit
|
||||||
|
|
|
@ -196,8 +196,7 @@ void MainWindow::ActionNewPP()
|
||||||
|
|
||||||
pattern->ClearGObjects();
|
pattern->ClearGObjects();
|
||||||
//Create single point
|
//Create single point
|
||||||
const quint32 id = pattern->AddGObject(new VPointF(qApp->toPixel((10+comboBoxDraws->count()*5)), qApp->toPixel(10),
|
const quint32 id = pattern->AddGObject(new VPointF(20+comboBoxDraws->count()*5, 20, "А", 5, 10));
|
||||||
"А", 5, 10));
|
|
||||||
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Source::FromGui, patternPieceName, path);
|
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Source::FromGui, patternPieceName, path);
|
||||||
sceneDraw->addItem(spoint);
|
sceneDraw->addItem(spoint);
|
||||||
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
||||||
|
|
|
@ -427,7 +427,7 @@ QString VDomDocument::UnitsToStr(const Unit &unit, const bool translate)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = "mm";
|
result = UnitMM;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Unit::Cm:
|
case Unit::Cm:
|
||||||
|
@ -437,17 +437,17 @@ QString VDomDocument::UnitsToStr(const Unit &unit, const bool translate)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = "cm";
|
result = UnitCM;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Unit::Inch:
|
case Unit::Inch:
|
||||||
if (translate)
|
if (translate)
|
||||||
{
|
{
|
||||||
result = QObject::tr("in", "inch abbreviation");
|
result = QObject::tr("inch");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = "inch";//I decided use full name in xml file.
|
result = UnitINCH;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -457,7 +457,7 @@ QString VDomDocument::UnitsToStr(const Unit &unit, const bool translate)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = "cm";
|
result = UnitCM;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user