diff --git a/ChangeLog.txt b/ChangeLog.txt index 87e885430..459b1cd7f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ - Fix Tape crash on Mac OS X. - Fix issue in VAbstractCurve::CurveIntersectAxis. - Improve editing a spline path through control points for locked angles. +- [smart-pattern/valentina#73] Notes for tools. # Version 0.7.36 October 24, 2020 - [#892] Show tooltip for piece node point. diff --git a/src/app/tape/dialogs/dialogdimensionlabels.ui b/src/app/tape/dialogs/dialogdimensionlabels.ui index 4dbf89a00..7a457da32 100644 --- a/src/app/tape/dialogs/dialogdimensionlabels.ui +++ b/src/app/tape/dialogs/dialogdimensionlabels.ui @@ -14,7 +14,7 @@ Dimension labels - + :/tapeicon/64x64/logo.png:/tapeicon/64x64/logo.png @@ -36,7 +36,7 @@ - Dimension: + Dimension: @@ -96,9 +96,7 @@ - - - + buttonBox diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index 874c154cc..75d933532 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -508,7 +508,7 @@ void VToolOptionsPropertyBrowser::itemClicked(QGraphicsItem *item) void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName) { - VFormulaProperty* itemLength = new VFormulaProperty(propertyName); + auto *itemLength = new VFormulaProperty(propertyName); itemLength->SetFormula(formula); AddProperty(itemLength, attrName); } @@ -517,7 +517,7 @@ void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName template void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly) { - auto itemName = new VPE::VStringProperty(propertyName); + auto *itemName = new VPE::VStringProperty(propertyName); itemName->setClearButtonEnable(true); itemName->setValue(qApp->TrVars()->VarToUser(i->name())); itemName->setReadOnly(readOnly); @@ -528,7 +528,7 @@ void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &propertyName) { - VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName); + auto *itemName = new VPE::VStringProperty(propertyName); itemName->setClearButtonEnable(true); itemName->setValue(i->nameP1()); AddProperty(itemName, AttrName1); @@ -538,7 +538,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &propertyName) { - VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName); + auto *itemName = new VPE::VStringProperty(propertyName); itemName->setClearButtonEnable(true); itemName->setValue(i->nameP2()); AddProperty(itemName, AttrName2); @@ -548,7 +548,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QString &propertyName, bool readOnly) { - auto itemSuffix = new VPE::VStringProperty(propertyName); + auto *itemSuffix = new VPE::VStringProperty(propertyName); itemSuffix->setClearButtonEnable(true); itemSuffix->setValue(i->Suffix()); itemSuffix->setReadOnly(readOnly); @@ -559,16 +559,25 @@ void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QStr void VToolOptionsPropertyBrowser::AddPropertyParentPointName(const QString &pointName, const QString &propertyName, const QString &propertyAttribure) { - auto itemParentPoint = new VPE::VLabelProperty(propertyName); + auto *itemParentPoint = new VPE::VLabelProperty(propertyName); itemParentPoint->setValue(pointName); AddProperty(itemParentPoint, propertyAttribure); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolOptionsPropertyBrowser::AddPropertyText(const QString &propertyName, const QString &text, + const QString &attrName) +{ + auto *itemText = new VPE::VTextProperty(propertyName); + itemText->setValue(text); + AddProperty(itemText, attrName); +} + //--------------------------------------------------------------------------------------------------------------------- template void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &propertyName) { - VPE::VEnumProperty* itemProperty = new VPE::VEnumProperty(propertyName); + auto *itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList({VToolOptionsPropertyBrowser::tr("First point"), VToolOptionsPropertyBrowser::tr("Second point")})); itemProperty->setValue(static_cast(i->GetCrossCirclesPoint())-1); @@ -579,7 +588,7 @@ void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString &propertyName) { - auto itemProperty = new VPE::VEnumProperty(propertyName); + auto *itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList({VToolOptionsPropertyBrowser::tr("Highest point"), VToolOptionsPropertyBrowser::tr("Lowest point")})); itemProperty->setValue(static_cast(i->GetVCrossPoint())-1); @@ -590,7 +599,7 @@ void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString template void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString &propertyName) { - auto itemProperty = new VPE::VEnumProperty(propertyName); + auto *itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList({VToolOptionsPropertyBrowser::tr("Leftmost point"), VToolOptionsPropertyBrowser::tr("Rightmost point")})); itemProperty->setValue(static_cast(i->GetHCrossPoint())-1); @@ -601,7 +610,7 @@ void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString template void VToolOptionsPropertyBrowser::AddPropertyAxisType(Tool *i, const QString &propertyName) { - auto itemProperty = new VPE::VEnumProperty(propertyName); + auto *itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList({VToolOptionsPropertyBrowser::tr("Vertical axis"), VToolOptionsPropertyBrowser::tr("Horizontal axis")})); itemProperty->setValue(static_cast(i->GetAxisType())-1); @@ -613,7 +622,7 @@ template void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName, const QMap &styles) { - VPE::VLineTypeProperty *lineTypeProperty = new VPE::VLineTypeProperty(propertyName); + auto *lineTypeProperty = new VPE::VLineTypeProperty(propertyName); lineTypeProperty->setStyles(styles); const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(styles, i->getLineType()); if (index == -1) @@ -629,7 +638,7 @@ template void VToolOptionsPropertyBrowser::AddPropertyCurvePenStyle(Tool *i, const QString &propertyName, const QMap &styles) { - VPE::VLineTypeProperty *penStyleProperty = new VPE::VLineTypeProperty(propertyName); + auto *penStyleProperty = new VPE::VLineTypeProperty(propertyName); penStyleProperty->setStyles(styles); const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(styles, i->GetPenStyle()); if (index == -1) @@ -645,7 +654,7 @@ template void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName, const QMap &colors, const QString &id) { - VPE::VLineColorProperty *lineColorProperty = new VPE::VLineColorProperty(propertyName); + auto *lineColorProperty = new VPE::VLineColorProperty(propertyName); lineColorProperty->setColors(colors); const qint32 index = VPE::VLineColorProperty::IndexOfColor(colors, i->GetLineColor()); if (index == -1) @@ -665,17 +674,18 @@ void VToolOptionsPropertyBrowser::AddPropertyApproximationScale(const QString &p settings.insert(QStringLiteral("Step"), 0.1); settings.insert(QStringLiteral("Precision"), 1); - VPE::VDoubleProperty *aScaleProperty = new VPE::VDoubleProperty(propertyName, settings); + auto *aScaleProperty = new VPE::VDoubleProperty(propertyName, settings); aScaleProperty->setValue(aScale); AddProperty(aScaleProperty, AttrAScale); } //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetPointName(const QString &name) +void VToolOptionsPropertyBrowser::SetPointName(VPE::VProperty *property) { - if (Tool *i = qgraphicsitem_cast(currentItem)) + if (auto *i = qgraphicsitem_cast(currentItem)) { + QString name = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); if (name == i->name()) { return; @@ -700,10 +710,11 @@ void VToolOptionsPropertyBrowser::SetPointName(const QString &name) //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetPointName1(const QString &name) +void VToolOptionsPropertyBrowser::SetPointName1(VPE::VProperty *property) { - if (Tool *i = qgraphicsitem_cast(currentItem)) + if (auto *i = qgraphicsitem_cast(currentItem)) { + QString name = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); if (name == i->nameP1()) { return; @@ -728,10 +739,11 @@ void VToolOptionsPropertyBrowser::SetPointName1(const QString &name) //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetPointName2(const QString &name) +void VToolOptionsPropertyBrowser::SetPointName2(VPE::VProperty *property) { - if (Tool *i = qgraphicsitem_cast(currentItem)) + if (auto *i = qgraphicsitem_cast(currentItem)) { + QString name = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); if (name == i->nameP2()) { return; @@ -756,10 +768,12 @@ void VToolOptionsPropertyBrowser::SetPointName2(const QString &name) //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetOperationSuffix(const QString &suffix) +void VToolOptionsPropertyBrowser::SetOperationSuffix(VPE::VProperty *property) { - if (Tool *item = qgraphicsitem_cast(currentItem)) + if (auto *item = qgraphicsitem_cast(currentItem)) { + QString suffix = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); + if (suffix == item->Suffix()) { return; @@ -817,10 +831,11 @@ Type VToolOptionsPropertyBrowser::GetCrossPoint(const QVariant &value) //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetCrossCirclesPoint(const QVariant &value) +void VToolOptionsPropertyBrowser::SetCrossCirclesPoint(VPE::VProperty *property) { - if (Tool *i = qgraphicsitem_cast(currentItem)) + if (auto *i = qgraphicsitem_cast(currentItem)) { + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); i->SetCrossCirclesPoint(GetCrossPoint(value)); } else @@ -831,11 +846,18 @@ void VToolOptionsPropertyBrowser::SetCrossCirclesPoint(const QVariant &value) //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetVCrossCurvesPoint(const QVariant &value) +void VToolOptionsPropertyBrowser::SetVCrossCurvesPoint(VPE::VProperty *property) { - if (auto i = qgraphicsitem_cast(currentItem)) + if (auto *i = qgraphicsitem_cast(currentItem)) { - i->SetVCrossPoint(GetCrossPoint(value)); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); + auto type = GetCrossPoint(value); + if (type == i->GetVCrossPoint()) + { + return; + } + + i->SetVCrossPoint(type); } else { @@ -845,10 +867,17 @@ void VToolOptionsPropertyBrowser::SetVCrossCurvesPoint(const QVariant &value) //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetHCrossCurvesPoint(const QVariant &value) +void VToolOptionsPropertyBrowser::SetHCrossCurvesPoint(VPE::VProperty *property) { - if (auto i = qgraphicsitem_cast(currentItem)) + if (auto *i = qgraphicsitem_cast(currentItem)) { + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); + auto type = GetCrossPoint(value); + if (type == i->GetHCrossPoint()) + { + return; + } + i->SetHCrossPoint(GetCrossPoint(value)); } else @@ -859,11 +888,238 @@ void VToolOptionsPropertyBrowser::SetHCrossCurvesPoint(const QVariant &value) //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::SetAxisType(const QVariant &value) +void VToolOptionsPropertyBrowser::SetAxisType(VPE::VProperty *property) { - if (auto i = qgraphicsitem_cast(currentItem)) + if (auto *i = qgraphicsitem_cast(currentItem)) { - i->SetAxisType(GetCrossPoint(value)); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); + AxisType type = GetCrossPoint(value); + if (type == i->GetAxisType()) + { + return; + } + + i->SetAxisType(type); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetNotes(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + QString notes = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); + if (notes == i->GetNotes()) + { + return; + } + + i->SetNotes(notes); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetLineType(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + QString type = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); + if (type == i->getLineType()) + { + return; + } + + i->SetLineType(type); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetLineColor(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + QString color = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); + if (color == i->GetLineColor()) + { + return; + } + + i->SetLineColor(color); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetFormulaLength(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaLength()) + { + return; + } + + i->SetFormulaLength(formula); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetFormulaAngle(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaAngle()) + { + return; + } + + i->SetFormulaAngle(formula); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetFormulaRadius(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaRadius()) + { + return; + } + + i->SetFormulaRadius(formula); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetFormulaF1(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaF1()) + { + return; + } + + i->SetFormulaF1(formula); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetFormulaF2(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaF2()) + { + return; + } + + i->SetFormulaF2(formula); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetPenStyle(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + QString pen = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toString(); + if (pen == i->GetPenStyle()) + { + return; + } + + i->SetPenStyle(pen); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetFormulaRotationAngle(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaRotationAngle()) + { + return; + } + + i->SetFormulaRotationAngle(formula); + } + else + { + qWarning()<<"Can't cast item"; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::SetApproximationScale(VPE::VProperty *property) +{ + if (auto *i = qgraphicsitem_cast(currentItem)) + { + double scale = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toDouble(); + if (VFuzzyComparePossibleNulls(scale, i->GetApproximationScale())) + { + return; + } + + i->SetApproximationScale(scale); } else { @@ -884,18 +1140,31 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VPE::VProperty *prop { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolBasePoint *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) + auto SetPosition = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); + i->SetBasePointPos(value.toPointF()); + } + else + { + qWarning()<<"Can't cast item"; + } + }; + switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 1: // QLatin1String("position") - i->SetBasePointPos(value.toPointF()); + SetPosition(property); + break; + case 61: // AttrNotes + SetNotes(property); break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolEndLine *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 4: // AttrLength - i->SetFormulaLength(value.value()); + SetFormulaLength(property); break; case 5: // AttrAngle - i->SetFormulaAngle(value.value()); + SetFormulaAngle(property); break; case 2: // AttrBasePoint (read only) break; + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolAlongLine *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 4: // AttrLength - i->SetFormulaLength(value.value()); + SetFormulaLength(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 2: // AttrBasePoint (read only) case 7: // AttrSecondPoint (read only) @@ -976,35 +1245,35 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolArc *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName Q_UNREACHABLE();//The attribute is read only break; case 8: // AttrRadius - i->SetFormulaRadius(value.value()); + SetFormulaRadius(property); break; case 9: // AttrAngle1 - i->SetFormulaF1(value.value()); + SetFormulaF1(property); break; case 10: // AttrAngle2 - i->SetFormulaF2(value.value()); + SetFormulaF2(property); break; case 27: // AttrTypeColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 11: // AttrCenter (read only) break; case 59: // AttrPenStyle - i->SetPenStyle(value.toString()); + SetPenStyle(property); break; case 60: // AttrAScale - i->SetApproximationScale(value.toDouble()); + SetApproximationScale(property); + break; + case 61: // AttrNotes + SetNotes(property); break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolArcWithLength *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName Q_UNREACHABLE();//The attribute is read only break; case 8: // AttrRadius - i->SetFormulaRadius(value.value()); + SetFormulaRadius(property); break; case 9: // AttrAngle1 - i->SetFormulaF1(value.value()); + SetFormulaF1(property); break; case 4: // AttrLength - i->SetFormulaLength(value.value()); + SetFormulaLength(property); break; case 27: // AttrTypeColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 11: // AttrCenter (read only) break; case 59: // AttrPenStyle - i->SetPenStyle(value.toString()); + SetPenStyle(property); break; case 60: // AttrAScale - i->SetApproximationScale(value.toDouble()); + SetApproximationScale(property); + break; + case 61: // AttrNotes + SetNotes(property); break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolBisector *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 4: // AttrLength - i->SetFormulaLength(value.value()); + SetFormulaLength(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 6: // AttrFirstPoint (read only) case 2: // AttrBasePoint (read only) case 12: // AttrThirdPoint (read only) break; + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) { case 32: // AttrName1 - SetPointName1(value.toString()); + SetPointName1(property); break; case 33: // AttrName2 - SetPointName2(value.toString()); + SetPointName2(property); break; case 6: // AttrFirstPoint (read only) case 7: // AttrSecondPoint (read only) @@ -1109,6 +1377,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VPE::VProperty *proper case 44: // AttrDartP2 (read only) case 45: // AttrDartP3 (read only) break; + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolCutArc *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 4: // AttrLength - i->SetFormula(value.value()); + SetFormulaLength(property); break; case 13: // AttrArc (read only) break; + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolCutSpline *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 4: // AttrLength - i->SetFormula(value.value()); + SetFormulaLength(property); break; case 46: // AttrCurve (read only) break; + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolCutSplinePath *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 4: // AttrLength - i->SetFormula(value.value()); + SetFormulaLength(property); break; case 46: // AttrCurve (read only) break; + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolHeight *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 2: // AttrBasePoint (read only) case 16: // AttrP1Line (read only) @@ -1229,18 +1500,18 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolLine *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 6: // AttrFirstPoint (read only) case 7: // AttrSecondPoint (read only) @@ -1256,13 +1527,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VPE::VProperty *pr { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 18: // AttrP1Line1 (read only) case 19: // AttrP2Line1 (read only) @@ -1280,27 +1553,45 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolNormal *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) + auto SetAngle = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + double value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).toDouble(); + if (VFuzzyComparePossibleNulls(value, i->GetAngle())) + { + return; + } + + i->SetAngle(value); + } + else + { + qWarning()<<"Can't cast item"; + } + }; + switch (PropertiesList().indexOf(id)) { case 4: // AttrLength - i->SetFormulaLength(value.value()); + SetFormulaLength(property); break; case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 5: // AttrAngle - i->SetAngle(value.toDouble()); + SetAngle(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 2: // AttrBasePoint (read only) case 7: // AttrSecondPoint (read only) @@ -1316,18 +1607,36 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VPE::VProperty *p { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolPointOfContact *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) + auto SetArcRadius = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->getArcRadius()) + { + return; + } + + i->setArcRadius(formula); + } + else + { + qWarning()<<"Can't cast item"; + } + }; + switch (PropertiesList().indexOf(id)) { case 8: // AttrRadius - i->setArcRadius(value.value()); + SetArcRadius(property); break; case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 11: // AttrCenter (read only) case 6: // AttrFirstPoint (read only) @@ -1344,13 +1653,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VPE::VProper { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 6: // AttrFirstPoint (read only) case 7: // AttrSecondPoint (read only) @@ -1371,17 +1682,14 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPE::VPr switch (PropertiesList().indexOf(id)) { case 0: // AttrName - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); - SetPointName(value.toString()); + SetPointName(property); break; - } case 28: // AttrCrossPoint - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); - SetCrossCirclesPoint(value); + SetCrossCirclesPoint(property); + break; + case 61: // AttrNotes + SetNotes(property); break; - } case 47: // AttrFirstArc (read only) case 48: // AttrSecondArc (read only) break; @@ -1398,27 +1706,57 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VPE:: const QString id = propertyToId[property]; - VToolPointOfIntersectionCircles *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) + auto SetFirstCircleRadius = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFirstCircleRadius()) + { + return; + } + + i->SetFirstCircleRadius(formula); + } + else + { + qWarning()<<"Can't cast item"; + } + }; + + auto SetSecondCircleRadius = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetSecondCircleRadius()) + { + return; + } + + i->SetSecondCircleRadius(formula); + } + else + { + qWarning()<<"Can't cast item"; + } + }; switch (PropertiesList().indexOf(id)) { case 0: // AttrName - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); - SetPointName(value.toString()); + SetPointName(property); break; - } case 28: // AttrCrossPoint - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); - SetCrossCirclesPoint(value); + SetCrossCirclesPoint(property); break; - } case 29: // AttrC1Radius - i->SetFirstCircleRadius(property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value()); + SetFirstCircleRadius(property); break; case 30: // AttrC2Radius - i->SetSecondCircleRadius(property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value()); + SetSecondCircleRadius(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 49: // AttrC1Center (read only) case 50: // AttrC2Center (read only) @@ -1439,23 +1777,17 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPE::V switch (PropertiesList().indexOf(id)) { case 0: // AttrName - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); - SetPointName(value.toString()); + SetPointName(property); break; - } case 34: // AttrVCrossPoint - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); - SetVCrossCurvesPoint(value); + SetVCrossCurvesPoint(property); break; - } case 35: // AttrHCrossPoint - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); - SetHCrossCurvesPoint(value); + SetHCrossCurvesPoint(property); + break; + case 61: // AttrNotes + SetNotes(property); break; - } case 51: // AttrCurve1 (read only) case 52: // AttrCurve2 (read only) break; @@ -1472,25 +1804,38 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPE::V const QString id = propertyToId[property]; - VToolPointFromCircleAndTangent *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) + auto SetCircleRadius = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetCircleRadius()) + { + return; + } + + i->SetCircleRadius(formula); + } + else + { + qWarning()<<"Can't cast item"; + } + }; + switch (PropertiesList().indexOf(id)) { case 0: // AttrName - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); - SetPointName(value.toString()); + SetPointName(property); break; - } case 31: // AttrCRadius - i->SetCircleRadius(property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value()); + SetCircleRadius(property); break; case 28: // AttrCrossPoint - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); - SetCrossCirclesPoint(value); + SetCrossCirclesPoint(property); + break; + case 61: // AttrNotes + SetNotes(property); break; - } case 53: // AttrCCenter (read only) case 54: // AttrTangent (read only) break; @@ -1510,17 +1855,14 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VPE::VPro switch (PropertiesList().indexOf(id)) { case 0: // AttrName - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); - SetPointName(value.toString()); + SetPointName(property); break; - } case 28: // AttrCrossPoint - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); - SetCrossCirclesPoint(value); + SetCrossCirclesPoint(property); + break; + case 61: // AttrNotes + SetNotes(property); break; - } case 54: // AttrTangent (read only) case 13: // AttrArc (read only) break; @@ -1535,24 +1877,24 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VPE::VProperty *pr { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolShoulderPoint *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 4: // AttrLength - i->SetFormulaLength(value.value()); + SetFormulaLength(property); break; case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 6: // AttrFirstPoint (read only) case 2: // AttrBasePoint (read only) @@ -1572,7 +1914,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VPE::VProperty *property) QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - auto i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); SCASSERT(i != nullptr) VSpline spl = i->getSpline(); @@ -1612,15 +1954,18 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VPE::VProperty *property) } break; case 27: // AttrTypeColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 59: // AttrPenStyle - i->SetPenStyle(value.toString()); + SetPenStyle(property); break; case 60: // AttrAScale spl.SetApproximationScale(value.toDouble()); i->setSpline(spl); break; + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - auto i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) - switch (PropertiesList().indexOf(id)) { case 0: // AttrName Q_UNREACHABLE();//The attribute is read only break; case 27: // AttrTypeColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 59: // AttrPenStyle - i->SetPenStyle(value.toString()); + SetPenStyle(property); break; case 60: // AttrAScale { + auto *i = qgraphicsitem_cast(currentItem); + SCASSERT(i != nullptr) + + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); VCubicBezier spl = i->getSpline(); spl.SetApproximationScale(value.toDouble()); i->setSpline(spl); break; } + case 61: // AttrNotes + SetNotes(property); + break; case 55: // AttrPoint1 (read only) case 56: // AttrPoint2 (read only) case 57: // AttrPoint3 (read only) @@ -1672,29 +2020,33 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VPE::VProperty *prope { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolSplinePath *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName Q_UNREACHABLE();//The attribute is read only break; case 27: // AttrTypeColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 59: // AttrPenStyle - i->SetPenStyle(value.toString()); + SetPenStyle(property); break; case 60: // AttrAScale { + auto *i = qgraphicsitem_cast(currentItem); + SCASSERT(i != nullptr) + + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); VSplinePath spl = i->getSplinePath(); spl.SetApproximationScale(value.toDouble()); i->setSplinePath(spl); break; } + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolCubicBezierPath *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName Q_UNREACHABLE();//The attribute is read only break; case 27: // AttrTypeColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 59: // AttrPenStyle - i->SetPenStyle(value.toString()); + SetPenStyle(property); break; case 60: // AttrAScale { + auto *i = qgraphicsitem_cast(currentItem); + SCASSERT(i != nullptr) + + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); VCubicBezierPath spl = i->getSplinePath(); spl.SetApproximationScale(value.toDouble()); i->setSplinePath(spl); break; } + case 61: // AttrNotes + SetNotes(property); + break; default: qWarning()<<"Unknown property type. id = "<data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 23: // AttrAxisP1 (read only) case 24: // AttrAxisP2 (read only) @@ -1764,24 +2122,24 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VPE::VProperty { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 5: // AttrAngle - i->SetFormulaAngle(value.value()); + SetFormulaAngle(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 2: // AttrBasePoint (read only) case 6: // AttrFirstPoint (read only) @@ -1798,24 +2156,24 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VPE::VPropert { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName - SetPointName(value.toString()); + SetPointName(property); break; case 3: // AttrTypeLine - i->SetTypeLine(value.toString()); + SetLineType(property); break; case 26: // AttrTypeLineColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 5: // AttrAngle - i->SetFormulaAngle(value.value()); + SetFormulaAngle(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 2: // AttrBasePoint (read only) case 46: // AttrCurve (read only) @@ -1831,18 +2189,18 @@ void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VPE::VProperty *propert { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolRotation *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 38: // AttrSuffix - SetOperationSuffix(value.toString()); + SetOperationSuffix(property); break; case 5: // AttrAngle - i->SetFormulaAngle(value.value()); + SetFormulaAngle(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 11: // AttrCenter (read only) break; @@ -1857,24 +2215,24 @@ void VToolOptionsPropertyBrowser::ChangeDataToolMove(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolMove *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 38: // AttrSuffix - SetOperationSuffix(value.toString()); + SetOperationSuffix(property); break; case 5: // AttrAngle - i->SetFormulaAngle(value.value()); + SetFormulaAngle(property); break; case 4: // AttrLength - i->SetFormulaLength(value.value()); + SetFormulaLength(property); break; case 42: // AttrRotationAngle - i->SetFormulaRotationAngle(value.value()); + SetFormulaRotationAngle(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 11: // AttrCenter (read only) break; @@ -1889,13 +2247,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VPE::VProperty *p { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) { case 38: // AttrSuffix - SetOperationSuffix(value.toString()); + SetOperationSuffix(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 6: // AttrFirstPoint case 7: // AttrSecondPoint @@ -1911,19 +2271,18 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VPE::VProperty *p { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) { case 39: // AttrAxisType - { - const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); - SetAxisType(value); + SetAxisType(property); break; - } case 38: // AttrSuffix - SetOperationSuffix(value.toString()); + SetOperationSuffix(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 11: // AttrCenter (read only) break; @@ -1938,33 +2297,69 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VPE::VProperty *pr { SCASSERT(property != nullptr) - QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; - VToolEllipticalArc *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr) + auto SetFormulaRadius1 = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaRadius1()) + { + return; + } + + i->SetFormulaRadius1(formula); + } + else + { + qWarning()<<"Can't cast item"; + } + }; + + auto SetFormulaRadius2 = [this](VPE::VProperty *property) + { + if (auto *i = qgraphicsitem_cast(currentItem)) + { + VFormula formula = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole).value(); + if (formula == i->GetFormulaRadius2()) + { + return; + } + + i->SetFormulaRadius2(formula); + } + else + { + qWarning()<<"Can't cast item"; + } + }; + switch (PropertiesList().indexOf(id)) { case 40://AttrRadius1 - i->SetFormulaRadius1(value.value()); + SetFormulaRadius1(property); break; case 41://AttrRadius2 - i->SetFormulaRadius2(value.value()); + SetFormulaRadius2(property); break; case 9://AttrAngle1 - i->SetFormulaF1(value.value()); + SetFormulaF1(property); break; case 10://AttrAngle2 - i->SetFormulaF2(value.value()); + SetFormulaF2(property); break; case 42://AttrRotationAngle - i->SetFormulaRotationAngle(value.value()); + SetFormulaRotationAngle(property); break; case 27://AttrColor - i->SetLineColor(value.toString()); + SetLineColor(property); break; case 59: // AttrPenStyle - i->SetPenStyle(value.toString()); + SetPenStyle(property); + break; + case 61: // AttrNotes + SetNotes(property); break; case 11: // AttrCenter (read only) break; @@ -1977,21 +2372,23 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VPE::VProperty *pr //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolSinglePoint(QGraphicsItem *item) { - VToolBasePoint *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Base point")); AddPropertyObjectName(i, tr("Point label:")); - VPE::VPointFProperty* itemPosition = new VPE::VPointFProperty(tr("Position:")); + auto *itemPosition = new VPE::VPointFProperty(tr("Position:")); itemPosition->setValue(i->GetBasePointPos()); AddProperty(itemPosition, QLatin1String("position")); + + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolEndLine(QGraphicsItem *item) { - VToolEndLine *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point at distance and angle")); @@ -2001,12 +2398,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolEndLine(QGraphicsItem *item) AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); AddPropertyFormula(tr("Angle:"), i->GetFormulaAngle(), AttrAngle); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item) { - VToolAlongLine *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point at distance along line")); @@ -2016,12 +2414,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item) AddPropertyLineType(i, tr("Line type:"), LineStylesPics()); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolArc(QGraphicsItem *item) { - VToolArc *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Arc")); @@ -2033,12 +2432,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArc(QGraphicsItem *item) AddPropertyCurvePenStyle(i, tr("Pen style:"), CurvePenStylesPics()); AddPropertyLineColor(i, tr("Color:"), VAbstractTool::ColorsList(), AttrColor); AddPropertyApproximationScale(tr("Approximation scale:"), i->GetApproximationScale()); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolArcWithLength(QGraphicsItem *item) { - VToolArcWithLength *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Arc with given length")); @@ -2050,12 +2450,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArcWithLength(QGraphicsItem *it AddPropertyCurvePenStyle(i, tr("Pen style:"), CurvePenStylesPics()); AddPropertyLineColor(i, tr("Color:"), VAbstractTool::ColorsList(), AttrColor); AddPropertyApproximationScale(tr("Approximation scale:"), i->GetApproximationScale()); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item) { - VToolBisector *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point along bisector")); @@ -2066,12 +2467,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item) AddPropertyLineType(i, tr("Line type:"), LineStylesPics()); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolTrueDarts(QGraphicsItem *item) { - VToolTrueDarts *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("True darts")); @@ -2082,48 +2484,52 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolTrueDarts(QGraphicsItem *item) AddPropertyParentPointName(i->DartP1Name(), tr("First dart point:"), AttrDartP1); AddPropertyParentPointName(i->DartP2Name(), tr("First dart point:"), AttrDartP2); AddPropertyParentPointName(i->DartP3Name(), tr("First dart point:"), AttrDartP3); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolCutArc(QGraphicsItem *item) { - VToolCutArc *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Cut arc tool")); AddPropertyObjectName(i, tr("Point label:")); AddPropertyParentPointName(i->CurveName(), tr("Arc:"), AttrArc); - AddPropertyFormula(tr("Length:"), i->GetFormula(), AttrLength); + AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolCutSpline(QGraphicsItem *item) { - VToolCutSpline *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool for segmenting a curve")); AddPropertyObjectName(i, tr("Point label:")); AddPropertyParentPointName(i->CurveName(), tr("Curve:"), AttrCurve); - AddPropertyFormula(tr("Length:"), i->GetFormula(), AttrLength); + AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolCutSplinePath(QGraphicsItem *item) { - VToolCutSplinePath *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool segment a pathed curve")); AddPropertyObjectName(i, tr("Point label:")); AddPropertyParentPointName(i->CurveName(), tr("Curve:"), AttrCurve); - AddPropertyFormula(tr("Length:"), i->GetFormula(), AttrLength); + AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolHeight(QGraphicsItem *item) { - VToolHeight *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Perpendicular point along line")); @@ -2133,12 +2539,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolHeight(QGraphicsItem *item) AddPropertyParentPointName(i->SecondLinePointName(), tr("Second line point:"), AttrP2Line); AddPropertyLineType(i, tr("Line type:"), LineStylesPics()); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item) { - VToolLine *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Line between points")); @@ -2148,12 +2555,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item) styles.remove(TypeLineNone); AddPropertyLineType(i, tr("Line type:"), styles); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersect(QGraphicsItem *item) { - VToolLineIntersect *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point at line intersection")); @@ -2162,12 +2570,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersect(QGraphicsItem *it AddPropertyParentPointName(i->Line1P2Name(), tr("First line (second point):"), AttrP2Line1); AddPropertyParentPointName(i->Line2P1Name(), tr("Second line (first point):"), AttrP1Line2); AddPropertyParentPointName(i->Line2P2Name(), tr("Second line (second point):"), AttrP2Line2); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) { - VToolNormal *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point along perpendicular")); @@ -2178,18 +2587,20 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) AddPropertyLineType(i, tr("Line type:"), LineStylesPics()); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); - VPE::VDoubleProperty* itemAngle = new VPE::VDoubleProperty(tr("Additional angle degrees:")); + auto *itemAngle = new VPE::VDoubleProperty(tr("Additional angle degrees:")); itemAngle->setValue(i->GetAngle()); itemAngle->setSetting("Min", -360); itemAngle->setSetting("Max", 360); itemAngle->setSetting("Precision", 3); AddProperty(itemAngle, AttrAngle); + + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfContact(QGraphicsItem *item) { - VToolPointOfContact *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point at intersection of arc and line")); @@ -2198,24 +2609,26 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfContact(QGraphicsItem *i AddPropertyParentPointName(i->FirstPointName(), tr("Top of the line:"), AttrFirstPoint); AddPropertyParentPointName(i->SecondPointName(), tr("End of the line:"), AttrSecondPoint); AddPropertyFormula(tr("Radius:"), i->getArcRadius(), AttrRadius); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersection(QGraphicsItem *item) { - VToolPointOfIntersection *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool to make point from x & y of two other points")); AddPropertyObjectName(i, tr("Point label:")); AddPropertyParentPointName(i->FirstPointName(), tr("X: vertical point:"), AttrFirstPoint); AddPropertyParentPointName(i->SecondPointName(), tr("Y: horizontal point:"), AttrSecondPoint); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionArcs(QGraphicsItem *item) { - VToolPointOfIntersectionArcs *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool to make point from intersection two arcs")); @@ -2223,12 +2636,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionArcs(QGraphi AddPropertyParentPointName(i->FirstArcName(), tr("First arc:"), AttrFirstArc); AddPropertyParentPointName(i->SecondArcName(), tr("Second arc:"), AttrSecondArc); AddPropertyCrossPoint(i, tr("Take:")); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCircles(QGraphicsItem *item) { - VToolPointOfIntersectionCircles *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool to make point from intersection two circles")); @@ -2238,6 +2652,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCircles(QGra AddPropertyFormula(tr("First circle radius:"), i->GetFirstCircleRadius(), AttrC1Radius); AddPropertyFormula(tr("Second circle radius:"), i->GetSecondCircleRadius(), AttrC2Radius); AddPropertyCrossPoint(i, tr("Take:")); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -2252,12 +2667,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCurves(QGrap AddPropertyParentPointName(i->SecondCurveName(), tr("Second curve:"), AttrCurve2); AddPropertyVCrossPoint(i, tr("Vertical correction:")); AddPropertyHCrossPoint(i, tr("Horizontal correction:")); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromCircleAndTangent(QGraphicsItem *item) { - VToolPointFromCircleAndTangent *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool to make point from circle and tangent")); @@ -2266,12 +2682,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromCircleAndTangent(QGrap AddPropertyParentPointName(i->TangentPointName(), tr("Tangent point:"), AttrTangent); AddPropertyFormula(tr("Circle radius:"), i->GetCircleRadius(), AttrCRadius); AddPropertyCrossPoint(i, tr("Take:")); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromArcAndTangent(QGraphicsItem *item) { - VToolPointFromArcAndTangent *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool to make point from arc and tangent")); @@ -2279,12 +2696,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromArcAndTangent(QGraphic AddPropertyParentPointName(i->TangentPointName(), tr("Tangent point:"), AttrTangent); AddPropertyParentPointName(i->ArcName(), tr("Arc:"), AttrArc); AddPropertyCrossPoint(i, tr("Take:")); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *item) { - VToolShoulderPoint *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Special point on shoulder")); @@ -2295,6 +2713,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *it AddPropertyLineType(i, tr("Line type:"), LineStylesPics()); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -2339,6 +2758,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSpline(QGraphicsItem *item) AddPropertyCurvePenStyle(i, tr("Pen style:"), CurvePenStylesPics()); AddPropertyLineColor(i, tr("Color:"), VAbstractTool::ColorsList(), AttrColor); AddPropertyApproximationScale(tr("Approximation scale:"), spl.GetApproximationScale()); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -2356,12 +2776,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCubicBezier(QGraphicsItem *item AddPropertyCurvePenStyle(i, tr("Pen style:"), CurvePenStylesPics()); AddPropertyLineColor(i, tr("Color:"), VAbstractTool::ColorsList(), AttrColor); AddPropertyApproximationScale(tr("Approximation scale:"), i->getSpline().GetApproximationScale()); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolSplinePath(QGraphicsItem *item) { - VToolSplinePath *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool for path curve")); @@ -2369,12 +2790,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSplinePath(QGraphicsItem *item) AddPropertyCurvePenStyle(i, tr("Pen style:"), CurvePenStylesPics()); AddPropertyLineColor(i, tr("Color:"), VAbstractTool::ColorsList(), AttrColor); AddPropertyApproximationScale(tr("Approximation scale:"), i->getSplinePath().GetApproximationScale()); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolCubicBezierPath(QGraphicsItem *item) { - VToolCubicBezierPath *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool cubic bezier curve")); @@ -2382,12 +2804,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCubicBezierPath(QGraphicsItem * AddPropertyCurvePenStyle(i, tr("Pen style:"), CurvePenStylesPics()); AddPropertyLineColor(i, tr("Color:"), VAbstractTool::ColorsList(), AttrColor); AddPropertyApproximationScale(tr("Approximation scale:"), i->getSplinePath().GetApproximationScale()); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolTriangle(QGraphicsItem *item) { - VToolTriangle *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool triangle")); @@ -2396,12 +2819,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolTriangle(QGraphicsItem *item) AddPropertyParentPointName(i->AxisP2Name(), tr("Second point of axis:"), AttrAxisP2); AddPropertyParentPointName(i->FirstPointName(), tr("First point:"), AttrFirstPoint); AddPropertyParentPointName(i->SecondPointName(), tr("Second point:"), AttrSecondPoint); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem *item) { - VToolLineIntersectAxis *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point intersection line and axis")); @@ -2412,12 +2836,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem AddPropertyLineType(i, tr("Line type:"), LineStylesPics()); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Angle:"), i->GetFormulaAngle(), AttrAngle); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsItem *item) { - VToolCurveIntersectAxis *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Point intersection curve and axis")); @@ -2427,24 +2852,26 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsIte AddPropertyLineType(i, tr("Line type:"), LineStylesPics()); AddPropertyLineColor(i, tr("Line color:"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Angle:"), i->GetFormulaAngle(), AttrAngle); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolRotation(QGraphicsItem *item) { - VToolRotation *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool rotation")); AddPropertyOperationSuffix(i, tr("Suffix:")); AddPropertyParentPointName(i->OriginPointName(), tr("Origin point:"), AttrCenter); AddPropertyFormula(tr("Angle:"), i->GetFormulaAngle(), AttrAngle); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolMove(QGraphicsItem *item) { - VToolMove *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool move")); @@ -2453,36 +2880,39 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolMove(QGraphicsItem *item) AddPropertyFormula(tr("Length:"), i->GetFormulaLength(), AttrLength); AddPropertyFormula(tr("Rotation angle:"), i->GetFormulaRotationAngle(), AttrRotationAngle); AddPropertyParentPointName(i->OriginPointName(), tr("Rotation origin point:"), AttrCenter); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolFlippingByLine(QGraphicsItem *item) { - VToolFlippingByLine *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool flipping by line")); AddPropertyOperationSuffix(i, tr("Suffix:")); AddPropertyParentPointName(i->FirstLinePointName(), tr("First line point:"), AttrFirstPoint); AddPropertyParentPointName(i->SecondLinePointName(), tr("Second line point:"), AttrSecondPoint); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolFlippingByAxis(QGraphicsItem *item) { - VToolFlippingByAxis *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Tool flipping by axis")); AddPropertyAxisType(i, tr("Axis type:")); AddPropertyOperationSuffix(i, tr("Suffix:")); AddPropertyParentPointName(i->OriginPointName(), tr("Origin point:"), AttrCenter); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::ShowOptionsToolEllipticalArc(QGraphicsItem *item) { - VToolEllipticalArc *i = qgraphicsitem_cast(item); + auto *i = qgraphicsitem_cast(item); i->ShowVisualization(true); formView->setTitle(tr("Elliptical arc")); @@ -2493,20 +2923,22 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolEllipticalArc(QGraphicsItem *it AddPropertyFormula(tr("Second angle:"), i->GetFormulaF2(), AttrAngle2); AddPropertyFormula(tr("Rotation angle:"), i->GetFormulaRotationAngle(), AttrRotationAngle); AddPropertyLineColor(i, tr("Color:"), VAbstractTool::ColorsList(), AttrColor); + AddPropertyText(tr("Notes:"), i->GetNotes(), AttrNotes); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolSinglePoint() { - VToolBasePoint *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); idToProperty[QLatin1String("position")]->setValue(i->GetBasePointPos()); + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() { - VToolEndLine *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); { @@ -2530,12 +2962,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() QVariant valueBasePoint; valueBasePoint.setValue(i->BasePointName()); idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() { - VToolAlongLine *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); { @@ -2559,12 +2993,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondPointName()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() { - VToolArc *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); QVariant valueRadius; valueRadius.setValue(i->GetFormulaRadius()); @@ -2595,12 +3031,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() QVariant valueApproximationScale; valueApproximationScale.setValue(i->GetApproximationScale()); idToProperty[AttrAScale]->setValue(valueApproximationScale); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength() { - VToolArcWithLength *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); QVariant valueRadius; valueRadius.setValue(i->GetFormulaRadius()); @@ -2631,12 +3069,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength() QVariant valueApproximationScale; valueApproximationScale.setValue(i->GetApproximationScale()); idToProperty[AttrAScale]->setValue(valueApproximationScale); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() { - VToolBisector *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); @@ -2665,12 +3105,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() QVariant valueThirdPoint; valueThirdPoint.setValue(i->ThirdPointName()); idToProperty[AttrThirdPoint]->setValue(valueThirdPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolTrueDarts() { - VToolTrueDarts *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName1]->setValue(i->nameP1()); idToProperty[AttrName2]->setValue(i->nameP2()); @@ -2694,60 +3136,68 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolTrueDarts() QVariant valueDartThirdPoint; valueDartThirdPoint.setValue(i->DartP3Name()); idToProperty[AttrDartP3]->setValue(valueDartThirdPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolCutArc() { - VToolCutArc *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->GetFormula()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[AttrLength]->setValue(valueFormula); QVariant valueArc; valueArc.setValue(i->CurveName()); idToProperty[AttrArc]->setValue(valueArc); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSpline() { - VToolCutSpline *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->GetFormula()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[AttrLength]->setValue(valueFormula); QVariant valueCurve; valueCurve.setValue(i->CurveName()); idToProperty[AttrCurve]->setValue(valueCurve); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSplinePath() { - VToolCutSplinePath *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->GetFormula()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[AttrLength]->setValue(valueFormula); QVariant valueCurve; valueCurve.setValue(i->CurveName()); idToProperty[AttrCurve]->setValue(valueCurve); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() { - VToolHeight *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); @@ -2772,12 +3222,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() QVariant valueSecondLinePoint; valueSecondLinePoint.setValue(i->SecondLinePointName()); idToProperty[AttrP2Line]->setValue(valueSecondLinePoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() { - VToolLine *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); { const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(LineStylesPics(), i->getLineType()); @@ -2796,12 +3248,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondPointName()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersect() { - VToolLineIntersect *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); @@ -2820,12 +3274,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersect() QVariant valueLine2P2; valueLine2P2.setValue(i->Line2P2Name()); idToProperty[AttrP2Line2]->setValue(valueLine2P2); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() { - VToolNormal *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); @@ -2852,12 +3308,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondPointName()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfContact() { - VToolPointOfContact *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); QVariant valueFormula; valueFormula.setValue(i->getArcRadius()); @@ -2876,12 +3334,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfContact() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondPointName()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersection() { - VToolPointOfIntersection *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); @@ -2892,12 +3352,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersection() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondPointName()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionArcs() { - VToolPointOfIntersectionArcs *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); @@ -2909,12 +3371,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionArcs() QVariant valueSecondArc; valueSecondArc.setValue(i->SecondArcName()); idToProperty[AttrSecondArc]->setValue(valueSecondArc); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCircles() { - VToolPointOfIntersectionCircles *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); @@ -2934,12 +3398,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCircles() QVariant valueC2Center; valueC2Center.setValue(i->SecondCircleCenterPointName()); idToProperty[AttrC2Center]->setValue(valueC2Center); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCurves() { - auto i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrVCrossPoint]->setValue(static_cast(i->GetVCrossPoint())-1); @@ -2952,12 +3418,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCurves() QVariant valueCurve2; valueCurve2.setValue(i->SecondCurveName()); idToProperty[AttrCurve2]->setValue(valueCurve2); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromCircleAndTangent() { - VToolPointFromCircleAndTangent *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); @@ -2973,12 +3441,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromCircleAndTangent() QVariant valueTangentPoint; valueTangentPoint.setValue(i->TangentPointName()); idToProperty[AttrTangent]->setValue(valueTangentPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromArcAndTangent() { - VToolPointFromArcAndTangent *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); @@ -2990,12 +3460,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromArcAndTangent() QVariant valueArc; valueArc.setValue(i->ArcName()); idToProperty[AttrArc]->setValue(valueArc); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() { - VToolShoulderPoint *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); @@ -3024,12 +3496,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() QVariant valueThirdPoint; valueThirdPoint.setValue(i->ShoulderPointName()); idToProperty[AttrThirdPoint]->setValue(valueThirdPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline() { - auto i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); const VSpline spl = i->getSpline(); idToProperty[AttrName]->setValue(qApp->TrVars()->VarToUser(i->name())); @@ -3081,12 +3555,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline() QVariant valueApproximationScale; valueApproximationScale.setValue(spl.GetApproximationScale()); idToProperty[AttrAScale]->setValue(valueApproximationScale); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezier() { - auto i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(qApp->TrVars()->VarToUser(i->name())); @@ -3117,12 +3593,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezier() QVariant valueApproximationScale; valueApproximationScale.setValue(i->getSpline().GetApproximationScale()); idToProperty[AttrAScale]->setValue(valueApproximationScale); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath() { - auto i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(qApp->TrVars()->VarToUser(i->name())); @@ -3137,12 +3615,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath() QVariant valueApproximationScale; valueApproximationScale.setValue(i->getSplinePath().GetApproximationScale()); idToProperty[AttrAScale]->setValue(valueApproximationScale); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezierPath() { - auto i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(qApp->TrVars()->VarToUser(i->name())); @@ -3157,12 +3637,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezierPath() QVariant valueApproximationScale; valueApproximationScale.setValue(i->getSplinePath().GetApproximationScale()); idToProperty[AttrAScale]->setValue(valueApproximationScale); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolTriangle() { - VToolTriangle *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); @@ -3181,12 +3663,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolTriangle() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondPointName()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() { - VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); { @@ -3214,12 +3698,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondLinePoint()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() { - VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); { @@ -3243,12 +3729,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() QVariant valueCurve; valueCurve.setValue(i->CurveName()); idToProperty[AttrCurve]->setValue(valueCurve); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolRotation() { - VToolRotation *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrSuffix]->setValue(i->Suffix()); QVariant valueAngle; @@ -3258,12 +3746,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolRotation() QVariant valueOriginPoint; valueOriginPoint.setValue(i->OriginPointName()); idToProperty[AttrCenter]->setValue(valueOriginPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolMove() { - VToolMove *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrSuffix]->setValue(i->Suffix()); QVariant valueAngle; @@ -3281,12 +3771,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolMove() QVariant valueRotationOriginPoint; valueRotationOriginPoint.setValue(i->OriginPointName()); idToProperty[AttrCenter]->setValue(valueRotationOriginPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolFlippingByLine() { - VToolFlippingByLine *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrSuffix]->setValue(i->Suffix()); QVariant valueFirstPoint; @@ -3296,24 +3788,28 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolFlippingByLine() QVariant valueSecondPoint; valueSecondPoint.setValue(i->SecondLinePointName()); idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolFlippingByAxis() { - VToolFlippingByAxis *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); idToProperty[AttrAxisType]->setValue(static_cast(i->GetAxisType())-1); idToProperty[AttrSuffix]->setValue(i->Suffix()); QVariant valueOriginPoint; valueOriginPoint.setValue(i->OriginPointName()); idToProperty[AttrCenter]->setValue(valueOriginPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::UpdateOptionsToolEllipticalArc() { - VToolEllipticalArc *i = qgraphicsitem_cast(currentItem); + auto *i = qgraphicsitem_cast(currentItem); QVariant valueFormulaRadius1; valueFormulaRadius1.setValue(i->GetFormulaRadius1()); @@ -3341,6 +3837,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEllipticalArc() QVariant valueCenterPoint; valueCenterPoint.setValue(i->CenterPointName()); idToProperty[AttrCenter]->setValue(valueCenterPoint); + + idToProperty[AttrNotes]->setValue(i->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- @@ -3406,6 +3904,7 @@ QStringList VToolOptionsPropertyBrowser::PropertiesList() const << AttrPoint3 /* 57 */ << AttrPoint4 /* 58 */ << AttrPenStyle /* 59 */ - << AttrAScale; /* 60 */ + << AttrAScale /* 60 */ + << AttrNotes; /* 61 */ return attr; } diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.h b/src/app/valentina/core/vtooloptionspropertybrowser.h index c8075ce34..98dab938e 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.h +++ b/src/app/valentina/core/vtooloptionspropertybrowser.h @@ -67,31 +67,64 @@ private: void ShowItemOptions(QGraphicsItem *item); template - void SetPointName(const QString &name); + void SetPointName(VPE::VProperty *property); template - void SetPointName1(const QString &name); + void SetPointName1(VPE::VProperty *property); template - void SetPointName2(const QString &name); + void SetPointName2(VPE::VProperty *property); template - void SetOperationSuffix(const QString &suffix); + void SetOperationSuffix(VPE::VProperty *property); template Type GetCrossPoint(const QVariant &value); template - void SetCrossCirclesPoint(const QVariant &value); + void SetCrossCirclesPoint(VPE::VProperty *property); template - void SetVCrossCurvesPoint(const QVariant &value); + void SetVCrossCurvesPoint(VPE::VProperty *property); template - void SetHCrossCurvesPoint(const QVariant &value); + void SetHCrossCurvesPoint(VPE::VProperty *property); template - void SetAxisType(const QVariant &value); + void SetAxisType(VPE::VProperty *property); + + template + void SetNotes(VPE::VProperty *property); + + template + void SetLineType(VPE::VProperty *property); + + template + void SetLineColor(VPE::VProperty *property); + + template + void SetFormulaLength(VPE::VProperty *property); + + template + void SetFormulaAngle(VPE::VProperty *property); + + template + void SetFormulaRadius(VPE::VProperty *property); + + template + void SetFormulaF1(VPE::VProperty *property); + + template + void SetFormulaF2(VPE::VProperty *property); + + template + void SetPenStyle(VPE::VProperty *property); + + template + void SetFormulaRotationAngle(VPE::VProperty *property); + + template + void SetApproximationScale(VPE::VProperty *property); template void AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly = false); @@ -131,6 +164,7 @@ private: void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName); void AddPropertyParentPointName(const QString &pointName, const QString &propertyName, const QString &propertyAttribure); + void AddPropertyText(const QString &propertyName, const QString &text, const QString &attrName); QStringList PropertiesList() const; diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 33d1a2828..3ba2781e5 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -1166,7 +1166,7 @@ void VPattern::PointsWithLineCommonAttributes(const QDomElement &domElement, VTo //--------------------------------------------------------------------------------------------------------------------- void VPattern::PointsCommonAttributes(const QDomElement &domElement, VToolSinglePointInitData &initData) { - PointsCommonAttributes(domElement, initData.id, initData.mx, initData.my); + DrawPointsCommonAttributes(domElement, initData.id, initData.mx, initData.my, initData.notes); initData.name = GetParametrString(domElement, AttrName, QChar('A')); initData.showLabel = GetParametrBool(domElement, AttrShowLabel, trueStr); } @@ -1179,6 +1179,15 @@ void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id my = qApp->toPixel(GetParametrDouble(domElement, AttrMy, QStringLiteral("15.0"))); } +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::DrawPointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my, + QString ¬es) +{ + DrawToolsCommonAttributes(domElement, id, notes); + mx = qApp->toPixel(GetParametrDouble(domElement, AttrMx, QStringLiteral("10.0"))); + my = qApp->toPixel(GetParametrDouble(domElement, AttrMy, QStringLiteral("15.0"))); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ParsePointElement parse point tag. @@ -3259,7 +3268,7 @@ void VPattern::ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &d initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.firstLinePointId = GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); initData.secondLinePointId = GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); initData.suffix = GetParametrString(domElement, AttrSuffix, QString()); @@ -3291,7 +3300,7 @@ void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &d initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.originPointId = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); initData.axisType = static_cast(GetParametrUInt(domElement, AttrAxisType, QChar('1'))); initData.suffix = GetParametrString(domElement, AttrSuffix, QString()); @@ -4298,6 +4307,13 @@ void VPattern::ToolsCommonAttributes(const QDomElement &domElement, quint32 &id) id = GetParametrId(domElement); } +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::DrawToolsCommonAttributes(const QDomElement &domElement, quint32 &id, QString ¬es) +{ + ToolsCommonAttributes(domElement, id); + notes = GetParametrEmptyString(domElement, AttrNotes); +} + //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wswitch-default") diff --git a/src/app/valentina/xml/vpattern.h b/src/app/valentina/xml/vpattern.h index 88c5f17d0..2045d8964 100644 --- a/src/app/valentina/xml/vpattern.h +++ b/src/app/valentina/xml/vpattern.h @@ -169,9 +169,12 @@ private: void ParseIncrementsElement(const QDomNode& node, const Document &parse); void PrepareForParse(const Document &parse); void ToolsCommonAttributes(const QDomElement &domElement, quint32 &id); + void DrawToolsCommonAttributes(const QDomElement &domElement, quint32 &id, QString ¬es); void PointsWithLineCommonAttributes(const QDomElement &domElement, VToolLinePointInitData &initData); void PointsCommonAttributes(const QDomElement &domElement, VToolSinglePointInitData &initData); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my); + void DrawPointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my, + QString ¬es); void SplinesCommonAttributes(const QDomElement &domElement, quint32 &id, quint32 &idObject, quint32 &idTool); template diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index e592264c6..a75a0492d 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -133,6 +133,7 @@ const QString AttrPlaceLabelType = QStringLiteral("placeLabelType"); const QString AttrVersion = QStringLiteral("version"); const QString AttrFirstToCountour = QStringLiteral("firstToCountour"); const QString AttrLastToCountour = QStringLiteral("lastToCountour"); +const QString AttrNotes = QStringLiteral("notes"); const QString TypeLineNone = QStringLiteral("none"); const QString TypeLineLine = QStringLiteral("hair"); diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index ae91d264e..995b67ebe 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -151,6 +151,7 @@ extern const QString AttrPlaceLabelType; extern const QString AttrVersion; extern const QString AttrFirstToCountour; extern const QString AttrLastToCountour; +extern const QString AttrNotes; extern const QString TypeLineNone; extern const QString TypeLineLine; diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index 22c1f5128..c775ca329 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -60,6 +60,7 @@ schema/pattern/v0.8.6.xsd schema/pattern/v0.8.7.xsd schema/pattern/v0.8.8.xsd + schema/pattern/v0.8.9.xsd schema/multisize_measurements/v0.3.0.xsd schema/multisize_measurements/v0.4.0.xsd schema/multisize_measurements/v0.4.1.xsd diff --git a/src/libs/ifc/schema/pattern/v0.8.9.xsd b/src/libs/ifc/schema/pattern/v0.8.9.xsd new file mode 100644 index 000000000..02072e940 --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.8.9.xsd @@ -0,0 +1,1079 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index a995660a6..a3521fd6a 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -59,8 +59,8 @@ class QDomElement; */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.8"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.8.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.9"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.9.xsd"); //VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!! //VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!! @@ -238,7 +238,8 @@ QString VPatternConverter::XSDSchema(int ver) const std::make_pair(FORMAT_VERSION(0, 8, 5), QStringLiteral("://schema/pattern/v0.8.5.xsd")), std::make_pair(FORMAT_VERSION(0, 8, 6), QStringLiteral("://schema/pattern/v0.8.6.xsd")), std::make_pair(FORMAT_VERSION(0, 8, 7), QStringLiteral("://schema/pattern/v0.8.7.xsd")), - std::make_pair(FORMAT_VERSION(0, 8, 8), CurrentSchema) + std::make_pair(FORMAT_VERSION(0, 8, 8), QStringLiteral("://schema/pattern/v0.8.8.xsd")), + std::make_pair(FORMAT_VERSION(0, 8, 9), CurrentSchema) }; if (schemas.contains(ver)) @@ -491,6 +492,10 @@ void VPatternConverter::ApplyPatches() ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 8))); Q_FALLTHROUGH(); case (FORMAT_VERSION(0, 8, 8)): + ToV0_8_9(); + ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 9))); + Q_FALLTHROUGH(); + case (FORMAT_VERSION(0, 8, 9)): break; default: InvalidVersion(m_ver); @@ -508,7 +513,7 @@ void VPatternConverter::DowngradeToCurrentMaxVersion() bool VPatternConverter::IsReadOnly() const { // Check if attribute readOnly was not changed in file format - Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 8), + Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 9), "Check attribute readOnly."); // Possibly in future attribute readOnly will change position etc. @@ -1159,6 +1164,16 @@ void VPatternConverter::ToV0_8_8() Save(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_8_9() +{ + // TODO. Delete if minimal supported version is 0.8.9 + Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FORMAT_VERSION(0, 8, 9), + "Time to refactor the code."); + SetVersion(QStringLiteral("0.8.9")); + Save(); +} + //--------------------------------------------------------------------------------------------------------------------- void VPatternConverter::TagUnitToV0_2_0() { diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 6280b53c8..b973fc7c9 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -53,7 +53,7 @@ public: static const QString PatternMaxVerStr; static const QString CurrentSchema; static Q_DECL_CONSTEXPR const int PatternMinVer = FORMAT_VERSION(0, 1, 4); - static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 8); + static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 9); protected: virtual int MinVer() const override; @@ -131,6 +131,7 @@ private: void ToV0_8_6(); void ToV0_8_7(); void ToV0_8_8(); + void ToV0_8_9(); void TagUnitToV0_2_0(); void TagIncrementToV0_2_0(); diff --git a/src/libs/vformat/vpatternrecipe.cpp b/src/libs/vformat/vpatternrecipe.cpp index 921781aa6..0d86747e6 100644 --- a/src/libs/vformat/vpatternrecipe.cpp +++ b/src/libs/vformat/vpatternrecipe.cpp @@ -89,7 +89,7 @@ VPatternRecipe::VPatternRecipe(VContainer *data, VAbstractPattern *pattern, QObj QDomElement recipeElement = createElement(QStringLiteral("recipe")); recipeElement.appendChild(createComment(FileComment())); - SetAttribute(recipeElement, QStringLiteral("version"), QStringLiteral("1.1.0")); + SetAttribute(recipeElement, QStringLiteral("version"), QStringLiteral("1.2.0")); recipeElement.appendChild(Prerequisite()); recipeElement.appendChild(Content()); @@ -808,7 +808,7 @@ QDomElement VPatternRecipe::CutArc(const VToolRecord &record) QDomElement step = createElement(TagStep); ToolAttributes(step, tool); - Formula(step, tool->GetFormula(), AttrLength, AttrLengthValue); + Formula(step, tool->GetFormulaLength(), AttrLength, AttrLengthValue); SetAttribute(step, AttrArc, tool->CurveName()); return step; @@ -822,7 +822,7 @@ QDomElement VPatternRecipe::CutSpline(const VToolRecord &record) QDomElement step = createElement(TagStep); ToolAttributes(step, tool); - Formula(step, tool->GetFormula(), AttrLength, AttrLengthValue); + Formula(step, tool->GetFormulaLength(), AttrLength, AttrLengthValue); SetAttribute(step, VToolCutSpline::AttrSpline, tool->CurveName()); return step; @@ -836,7 +836,7 @@ QDomElement VPatternRecipe::CutSplinePath(const VToolRecord &record) QDomElement step = createElement(TagStep); ToolAttributes(step, tool); - Formula(step, tool->GetFormula(), AttrLength, AttrLengthValue); + Formula(step, tool->GetFormulaLength(), AttrLength, AttrLengthValue); SetAttribute(step, VToolCutSplinePath::AttrSplinePath, tool->CurveName()); return step; @@ -1105,6 +1105,7 @@ inline void VPatternRecipe::ToolAttributes(QDomElement &step, T *tool) { SetAttribute(step, AttrType, T::ToolType); SetAttribute(step, AttrLabel, tool->name()); + SetAttribute(step, AttrNotes, tool->GetNotes()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpropertyexplorer/plugins/vtextproperty.cpp b/src/libs/vpropertyexplorer/plugins/vtextproperty.cpp new file mode 100644 index 000000000..0e9ae1d1d --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vtextproperty.cpp @@ -0,0 +1,134 @@ +/************************************************************************ + ** + ** @file vtextproperty.cpp + ** @author Roman Telezhynskyi + ** @date 27 10, 2020 + ** + ** @brief + ** @copyright + ** All rights reserved. This program and the accompanying materials + ** are made available under the terms of the GNU Lesser General Public License + ** (LGPL) version 2.1 which accompanies this distribution, and is available at + ** http://www.gnu.org/licenses/lgpl-2.1.html + ** + ** This library 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 + ** Lesser General Public License for more details. + ** + *************************************************************************/ +#include "vtextproperty.h" +#include "../vproperty_p.h" + +#include +#include + +namespace +{ +//--------------------------------------------------------------------------------------------------------------------- +void SetTabStopDistance(QPlainTextEdit *edit, int tabWidthChar=4); +void SetTabStopDistance(QPlainTextEdit *edit, int tabWidthChar) +{ + const auto fontMetrics = edit->fontMetrics(); + + const QString testString(" "); + +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) + const int singleCharWidth = fontMetrics.width(testString); + edit->setTabStopWidth(tabWidthChar * singleCharWidth); +#else + // compute the size of a char in double-precision + static constexpr int bigNumber = 1000; // arbitrary big number. + const int many_char_width = fontMetrics.width(testString.repeated(bigNumber)); + const double singleCharWidthDouble = many_char_width / double(bigNumber); + // set the tab stop with double precision + edit->setTabStopDistance(tabWidthChar * singleCharWidthDouble); +#endif +} +} + + +VPE::VTextProperty::VTextProperty(const QString &name, const QMap &settings) + : VProperty(name, QVariant::String), + readOnly(false) +{ + VProperty::setSettings(settings); + d_ptr->VariantValue.setValue(QString()); + d_ptr->VariantValue.convert(QVariant::String); +} + +VPE::VTextProperty::VTextProperty(const QString &name) + : VProperty(name), + readOnly(false) +{ + d_ptr->VariantValue.setValue(QString()); + d_ptr->VariantValue.convert(QVariant::String); +} + +QWidget *VPE::VTextProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, + const QAbstractItemDelegate *delegate) +{ + Q_UNUSED(options) + Q_UNUSED(delegate) + + QPlainTextEdit* tmpEditor = new QPlainTextEdit(parent); + tmpEditor->setLocale(parent->locale()); + tmpEditor->setReadOnly(readOnly); + tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + tmpEditor->setPlainText(d_ptr->VariantValue.toString()); + SetTabStopDistance(tmpEditor); + + d_ptr->editor = tmpEditor; + return d_ptr->editor; +} + +QVariant VPE::VTextProperty::getEditorData(const QWidget *editor) const +{ + const QPlainTextEdit* tmpEditor = qobject_cast(editor); + if (tmpEditor) + { + return tmpEditor->toPlainText(); + } + + return QVariant(QString()); +} + +void VPE::VTextProperty::setReadOnly(bool readOnly) +{ + this->readOnly = readOnly; +} + +void VPE::VTextProperty::setSetting(const QString &key, const QVariant &value) +{ + if (key == QLatin1String("ReadOnly")) + { + setReadOnly(value.toBool()); + } +} + +QVariant VPE::VTextProperty::getSetting(const QString &key) const +{ + if (key == QLatin1String("ReadOnly")) + { + return readOnly; + } + else + return VProperty::getSetting(key); +} + +QStringList VPE::VTextProperty::getSettingKeys() const +{ + QStringList settings; + settings << QStringLiteral("ReadOnly"); + return settings; +} + +QString VPE::VTextProperty::type() const +{ + return QStringLiteral("string"); +} + +VPE::VProperty *VPE::VTextProperty::clone(bool include_children, VPE::VProperty *container) const +{ + return VProperty::clone(include_children, container ? container : new VTextProperty(getName(), getSettings())); +} diff --git a/src/libs/vpropertyexplorer/plugins/vtextproperty.h b/src/libs/vpropertyexplorer/plugins/vtextproperty.h new file mode 100644 index 000000000..91ddec63d --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vtextproperty.h @@ -0,0 +1,88 @@ +/************************************************************************ + ** + ** @file vtextproperty.h + ** @author Roman Telezhynskyi + ** @date 27 10, 2020 + ** + ** @brief + ** @copyright + ** All rights reserved. This program and the accompanying materials + ** are made available under the terms of the GNU Lesser General Public License + ** (LGPL) version 2.1 which accompanies this distribution, and is available at + ** http://www.gnu.org/licenses/lgpl-2.1.html + ** + ** This library 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 + ** Lesser General Public License for more details. + ** + *************************************************************************/ +#ifndef VTEXTPROPERTY_H +#define VTEXTPROPERTY_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../vproperty.h" +#include "../vpropertyexplorer_global.h" + +namespace VPE +{ + +//! Class for holding a text property +class VPROPERTYEXPLORERSHARED_EXPORT VTextProperty : public VProperty +{ +public: + VTextProperty(const QString& name, const QMap& settings); + + explicit VTextProperty(const QString& name); + + //! Returns an editor widget, or NULL if it doesn't supply one + //! \param parent The widget to which the editor will be added as a child + //! \options Render options + //! \delegate A pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and + //! slots. + virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) override; + + //! Gets the data from the widget + virtual QVariant getEditorData(const QWidget* editor) const override; + + void setReadOnly(bool readOnly); + + //! Sets the settings. + virtual void setSetting(const QString& key, const QVariant& value) override; + + //! Get the settings. This function has to be implemented in a subclass in order to have an effect + virtual QVariant getSetting(const QString& key) const override; + + //! Returns the list of keys of the property's settings + virtual QStringList getSettingKeys() const override; + + //! Returns a string containing the type of the property + virtual QString type() const override; + + //! Clones this property + //! \param include_children Indicates whether to also clone the children + //! \param container If a property is being passed here, no new VProperty is being created but instead it is tried + //! to fill all the data into container. This can also be used when subclassing this function. + //! \return Returns the newly created property (or container, if it was not NULL) + Q_REQUIRED_RESULT virtual VProperty* clone(bool include_children = true, + VProperty* container = nullptr) const override; +protected: + bool readOnly; + +private: + Q_DISABLE_COPY(VTextProperty) +}; + +} + +#endif // VTEXTPROPERTY_H diff --git a/src/libs/vpropertyexplorer/vproperties.h b/src/libs/vpropertyexplorer/vproperties.h index 8b2634b33..5ac50968f 100644 --- a/src/libs/vpropertyexplorer/vproperties.h +++ b/src/libs/vpropertyexplorer/vproperties.h @@ -37,5 +37,6 @@ #include "plugins/vwidgetproperty.h" #include "plugins/vlinecolorproperty.h" #include "plugins/vlabelproperty.h" +#include "plugins/vtextproperty.h" #endif // VPROPERTIES_H diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pri b/src/libs/vpropertyexplorer/vpropertyexplorer.pri index a647804a0..f71b6547c 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pri +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pri @@ -2,6 +2,7 @@ # This need for corect working file translations.pro SOURCES += \ + $$PWD/plugins/vtextproperty.cpp \ $$PWD/vproperty.cpp \ $$PWD/vpropertydelegate.cpp \ $$PWD/vpropertyfactorymanager.cpp \ @@ -35,6 +36,7 @@ SOURCES += \ *msvc*:SOURCES += $$PWD/stable.cpp HEADERS +=\ + $$PWD/plugins/vtextproperty.h \ $$PWD/vpropertyexplorer_global.h \ $$PWD/vpropertyfactorymanager_p.h \ $$PWD/vpropertytreeview_p.h \ diff --git a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp index 182cc5631..04b3e8ea1 100644 --- a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp +++ b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -304,19 +305,39 @@ bool VPE::VPropertyFormWidget::eventFilter(QObject *object, QEvent *event) if (event->type() == QEvent::KeyPress) { - switch (static_cast(event)->key()) + if (QPlainTextEdit *textEdit = qobject_cast(editor)) { - case Qt::Key_Tab: - case Qt::Key_Backtab: - case Qt::Key_Enter: - case Qt::Key_Return: - case Qt::Key_Escape: - commitData(editor); - event->accept(); - return true; - default: - return false; + switch (static_cast(event)->key()) + { + case Qt::Key_Escape: + commitData(editor); + event->accept(); + return true; + case Qt::Key_Tab: + case Qt::Key_Backtab: + case Qt::Key_Enter: + case Qt::Key_Return: + default: + return false; + } } + else + { + switch (static_cast(event)->key()) + { + case Qt::Key_Tab: + case Qt::Key_Backtab: + case Qt::Key_Enter: + case Qt::Key_Return: + case Qt::Key_Escape: + commitData(editor); + event->accept(); + return true; + default: + return false; + } + } + return false; } else if (event->type() == QEvent::FocusOut || (event->type() == QEvent::Hide && editor->isWindow())) { diff --git a/src/libs/vtools/dialogs/dialogtoolbox.cpp b/src/libs/vtools/dialogs/dialogtoolbox.cpp index 8d70b7d71..ef757a014 100644 --- a/src/libs/vtools/dialogs/dialogtoolbox.cpp +++ b/src/libs/vtools/dialogs/dialogtoolbox.cpp @@ -486,3 +486,24 @@ void CurrentCurveLength(vidtype curveId, VContainer *data) data->AddVariable(length); } + +//--------------------------------------------------------------------------------------------------------------------- +void SetTabStopDistance(QPlainTextEdit *edit, int tabWidthChar) +{ + SCASSERT(edit != nullptr) + const auto fontMetrics = edit->fontMetrics(); + + const QString testString(" "); + +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) + const int single_char_width = fontMetrics.width(testString); + edit->setTabStopWidth(tabWidthChar * single_char_width); +#else + // compute the size of a char in double-precision + static constexpr int bigNumber = 1000; // arbitrary big number. + const int many_char_width = fontMetrics.width(testString.repeated(bigNumber)); + const double singleCharWidthDouble = many_char_width / double(bigNumber); + // set the tab stop with double precision + edit->setTabStopDistance(tabWidthChar * singleCharWidthDouble); +#endif +} diff --git a/src/libs/vtools/dialogs/dialogtoolbox.h b/src/libs/vtools/dialogs/dialogtoolbox.h index 1db4a737e..97c99b410 100644 --- a/src/libs/vtools/dialogs/dialogtoolbox.h +++ b/src/libs/vtools/dialogs/dialogtoolbox.h @@ -86,5 +86,6 @@ bool EachPointLabelIsUnique(QListWidget *listWidget); QString DialogWarningIcon(); QFont NodeFont(QFont font, bool nodeExcluded = false); void CurrentCurveLength(vidtype curveId, VContainer *data); +void SetTabStopDistance(QPlainTextEdit *edit, int tabWidthChar=4); #endif // DIALOGTOOLBOX_H diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.cpp b/src/libs/vtools/dialogs/tools/dialogalongline.cpp index 7a3da95c7..0c178813f 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogalongline.cpp @@ -113,6 +113,9 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, quint32 toolId, QWidget // Call after initialization vis!!!! SetTypeLine(TypeLineNone);//By default don't show line + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -294,7 +297,19 @@ void DialogAlongLine::SetSecondPointId(quint32 value) VisToolAlongLine *line = qobject_cast(vis); SCASSERT(line != nullptr) - line->setObject2Id(value); + line->setObject2Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogAlongLine::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogAlongLine::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.h b/src/libs/vtools/dialogs/tools/dialogalongline.h index d8473f88a..74f498126 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.h +++ b/src/libs/vtools/dialogs/tools/dialogalongline.h @@ -71,6 +71,9 @@ public: quint32 GetSecondPointId() const; void SetSecondPointId(quint32 value); + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void Build(const Tool &type) override; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.ui b/src/libs/vtools/dialogs/tools/dialogalongline.ui index ff7bf85c0..0867dc0b4 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.ui +++ b/src/libs/vtools/dialogs/tools/dialogalongline.ui @@ -6,8 +6,8 @@ 0 0 - 412 - 288 + 446 + 365 @@ -20,317 +20,354 @@ - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - - 0 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - Point label: - - - - - - - First point: - - - - - - - - 0 - 0 - - - - First point of the line - - - - - - - Second point: - - - - - - - - 0 - 0 - - - - Second point of the line - - - - - - - Type of line: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - - - - 80 - 14 - - - - - - - - Line color: - - - - - - - - 0 - 0 - - - - - - - - - - - Unique label - - - Choose unique label. - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + + 0 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + Point label: + + + + + + + First point: + + + + + + + + 0 + 0 + + + + First point of the line + + + + + + + Second point: + + + + + + + + 0 + 0 + + + + Second point of the line + + + + + + + Type of line: + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + + + + 80 + 14 + + + + + + + + Line color: + + + + + + + + 0 + 0 + + + + + + + + + + + Unique label + + + Choose unique label. + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp index b69adf174..bad33739d 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp @@ -123,6 +123,9 @@ DialogArc::DialogArc(const VContainer *data, quint32 toolId, QWidget *parent) connect(ui->pushButtonGrowLengthF2, &QPushButton::clicked, this, &DialogArc::DeployF2TextEdit); vis = new VisToolArc(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -219,7 +222,19 @@ void DialogArc::SetApproximationScale(qreal value) VisToolArc *path = qobject_cast(vis); SCASSERT(path != nullptr) - path->setApproximationScale(value); + path->setApproximationScale(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogArc::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogArc::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogarc.h b/src/libs/vtools/dialogs/tools/dialogarc.h index 10de58807..09c1d30a3 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.h +++ b/src/libs/vtools/dialogs/tools/dialogarc.h @@ -73,6 +73,9 @@ public: qreal GetApproximationScale() const; void SetApproximationScale(qreal value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogarc.ui b/src/libs/vtools/dialogs/tools/dialogarc.ui index 9aa1e466d..4e953e4dd 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogarc.ui @@ -6,8 +6,8 @@ 0 0 - 425 - 395 + 407 + 456 @@ -20,639 +20,676 @@ - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Radius: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - First angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Second angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Center point: - - - - - - - Select center point of the arc - - - - - - - Pen style: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Color: - - - - - - - - - - - - - - Approximation scale: - - - - - - - Set approximation scale for this curve, 0 - use global value - - - 1 - - - 10.000000000000000 - - - 0.100000000000000 - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Radius: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + First angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Second angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Center point: + + + + + + + Select center point of the arc + + + + + + + Pen style: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Color: + + + + + + + + + + + + + + Approximation scale: + + + + + + + Set approximation scale for this curve, 0 - use global value + + + 1 + + + 10.000000000000000 + + + 0.100000000000000 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp index 36c8f9126..84c8d25f0 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp @@ -116,6 +116,9 @@ DialogArcWithLength::DialogArcWithLength(const VContainer *data, quint32 toolId, connect(ui->pushButtonGrowLengthArcLength, &QPushButton::clicked, this, &DialogArcWithLength::DeployLengthTextEdit); vis = new VisToolArcWithLength(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -245,7 +248,19 @@ void DialogArcWithLength::SetApproximationScale(qreal value) VisToolArcWithLength *path = qobject_cast(vis); SCASSERT(path != nullptr) - path->setApproximationScale(value); + path->setApproximationScale(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogArcWithLength::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogArcWithLength::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.h b/src/libs/vtools/dialogs/tools/dialogarcwithlength.h index edbe8f461..27fa4b967 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.h +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.h @@ -71,6 +71,9 @@ public: qreal GetApproximationScale() const; void SetApproximationScale(qreal value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui b/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui index 77cd6a763..f8b26604b 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui @@ -6,8 +6,8 @@ 0 0 - 339 - 395 + 370 + 458 @@ -17,631 +17,668 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Radius: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - First angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Center point: - - - - - - - - - - - - - Color: - - - - - - - Pen style: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Approximation scale: - - - - - - - Set approximation scale for this curve, 0 - use global value - - - 1 - - - 10.000000000000000 - - - 0.100000000000000 - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Radius: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + First angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Center point: + + + + + + + + + + + + + Color: + + + + + + + Pen style: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Approximation scale: + + + + + + + Set approximation scale for this curve, 0 - use global value + + + 1 + + + 10.000000000000000 + + + 0.100000000000000 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.cpp b/src/libs/vtools/dialogs/tools/dialogbisector.cpp index 02149eb73..64a3c8ada 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.cpp +++ b/src/libs/vtools/dialogs/tools/dialogbisector.cpp @@ -106,6 +106,9 @@ DialogBisector::DialogBisector(const VContainer *data, quint32 toolId, QWidget * this, &DialogBisector::PointNameChanged); vis = new VisToolBisector(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -345,6 +348,18 @@ void DialogBisector::SetLineColor(const QString &value) ChangeCurrentData(ui->comboBoxLineColor, value); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogBisector::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogBisector::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogBisector::SaveData() { diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.h b/src/libs/vtools/dialogs/tools/dialogbisector.h index a6092c585..bf2ca4f99 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.h +++ b/src/libs/vtools/dialogs/tools/dialogbisector.h @@ -74,6 +74,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.ui b/src/libs/vtools/dialogs/tools/dialogbisector.ui index 361c69dfc..29e9dce4a 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.ui +++ b/src/libs/vtools/dialogs/tools/dialogbisector.ui @@ -6,8 +6,8 @@ 0 0 - 428 - 321 + 405 + 358 @@ -17,306 +17,343 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - First point: - - - - - - - - - - - 0 - 0 - - - - Second point: - - - - - - - - - - - 0 - 0 - - - - Third point: - - - - - - - - - - Type of line: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Line color: - - - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + First point: + + + + + + + + + + + 0 + 0 + + + + Second point: + + + + + + + + + + + 0 + 0 + + + + Third point: + + + + + + + + + + Type of line: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Line color: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp b/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp index b60e668a6..1079e54e6 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp @@ -73,6 +73,9 @@ DialogCubicBezier::DialogCubicBezier(const VContainer *data, quint32 toolId, QWi this, &DialogCubicBezier::PointNameChanged); vis = new VisToolCubicBezier(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -276,3 +279,15 @@ const QSharedPointer DialogCubicBezier::GetP4() const { return data->GeometricObject(getCurrentObjectId(ui->comboBoxP4)); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCubicBezier::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCubicBezier::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezier.h b/src/libs/vtools/dialogs/tools/dialogcubicbezier.h index ccd495ef3..62ef7a925 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezier.h +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezier.h @@ -55,6 +55,9 @@ public: VCubicBezier GetSpline() const; void SetSpline(const VCubicBezier &spline); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void PointNameChanged() override; diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezier.ui b/src/libs/vtools/dialogs/tools/dialogcubicbezier.ui index ef69856d3..3a4c725a9 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezier.ui +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezier.ui @@ -6,8 +6,8 @@ 0 0 - 387 - 294 + 479 + 362 @@ -19,134 +19,154 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - Color: + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - - - - - - 0 - 0 - - - - - - - - Name: - - - - - - - true - - - - - - - First point: - - - - - - - - - - Second point: - - - - - - - - - - Third point: - - - - - - - - - - Fourth point: - - - - - - - - - - Pen Style: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Approximation Scale: - - - - - - - Set approximation scale for this curve, 0 - use global value - - - 1 - - - 10.000000000000000 - - - 0.100000000000000 - - - - + + + + First point: + + + + + + + + + + Second point: + + + + + + + + + + Third point: + + + + + + + + + + Fourth point: + + + + + + + + + + Pen Style: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Color: + + + + + + + + 0 + 0 + + + + + + + + Approximation Scale: + + + + + + + Set approximation scale for this curve, 0 - use global value + + + 1 + + + 10.000000000000000 + + + 0.100000000000000 + + + + + + + Name: + + + + + + + true + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp index 47d30cdaa..a734d8fa3 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp @@ -81,6 +81,9 @@ DialogCubicBezierPath::DialogCubicBezierPath(const VContainer *data, quint32 too this, &DialogCubicBezierPath::currentPointChanged); vis = new VisToolCubicBezierPath(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -360,3 +363,15 @@ void DialogCubicBezierPath::ValidatePath() ChangeColor(ui->labelName, color); ChangeColor(ui->labelPoint, color); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCubicBezierPath::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCubicBezierPath::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.h b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.h index 00c9e946b..e59f3c156 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.h +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.h @@ -56,6 +56,9 @@ public: VCubicBezierPath GetPath() const; void SetPath(const VCubicBezierPath &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void ShowDialog(bool click) override; diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.ui b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.ui index c529b16f3..da939fe8b 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.ui +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.ui @@ -6,8 +6,8 @@ 0 0 - 324 - 327 + 375 + 439 @@ -17,118 +17,155 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - + + + 0 + + + + Tool + + - + - - - Point: + + + + + + + Point: + + + + + + + + + + + + + + List of points - - + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + Color: + + + + + + + + + + Name: + + + + + + + true + + + + + + + Pen style: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Approximation scale: + + + + + + + Set approximation scale for this curve, 0 - use global value + + + 1 + + + 10.000000000000000 + + + 0.100000000000000 + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - - - - - List of points - - - - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - Color: - - - - - - - - - - Name: - - - - - - - true - - - - - - - Pen style: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Approximation scale: - - - - - - - Set approximation scale for this curve, 0 - use global value - - - 1 - - - 10.000000000000000 - - - 0.100000000000000 - - - - + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp index 1468624fe..2dadef0f5 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp @@ -96,6 +96,9 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, quint connect(timerFormula, &QTimer::timeout, this, &DialogCurveIntersectAxis::EvalAngle); vis = new VisToolCurveIntersectAxis(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -343,3 +346,15 @@ void DialogCurveIntersectAxis::closeEvent(QCloseEvent *event) ui->plainTextEditFormula->blockSignals(true); DialogTool::closeEvent(event); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCurveIntersectAxis::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCurveIntersectAxis::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h index a1550b337..6bb117784 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h @@ -69,6 +69,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void ShowDialog(bool click) override; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui index 2e3a4e44e..42d222f6c 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui @@ -6,8 +6,8 @@ 0 0 - 419 - 288 + 335 + 331 @@ -17,300 +17,337 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - - 4 - 0 - - - - Calculation - - - true - - - QPlainTextEdit::NoWrap - - - - - - - - 16 - 16 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Axis point: - - - - - - - - - - - - - - - 0 - 0 - - - - Curve: - - - - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - - 0 - 0 - - - - Unique label - - - Choose unique label. - - - - - - - Type of line: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Line color: - - - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + + 4 + 0 + + + + Calculation + + + true + + + QPlainTextEdit::NoWrap + + + + + + + + 16 + 16 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Axis point: + + + + + + + + + + + + + + + 0 + 0 + + + + Curve: + + + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + + 0 + 0 + + + + Unique label + + + Choose unique label. + + + + + + + Type of line: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Line color: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp index 58a4e1132..4c9ae5de1 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -94,6 +94,9 @@ DialogCutArc::DialogCutArc(const VContainer *data, quint32 toolId, QWidget *pare connect(ui->comboBoxArc, &QComboBox::currentTextChanged, this, &DialogCutArc::ArcChanged); vis = new VisToolCutArc(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -264,3 +267,15 @@ quint32 DialogCutArc::getArcId() const { return getCurrentObjectId(ui->comboBoxArc); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutArc::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutArc::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.h b/src/libs/vtools/dialogs/tools/dialogcutarc.h index cb39ec10a..ec88a1598 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.h +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.h @@ -62,6 +62,9 @@ public: quint32 getArcId() const; void setArcId(quint32 value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.ui b/src/libs/vtools/dialogs/tools/dialogcutarc.ui index f348d1a0f..b50e73564 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.ui @@ -6,8 +6,8 @@ 0 0 - 412 - 189 + 334 + 247 @@ -17,235 +17,272 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Arc: - - - - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Arc: + + + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp index 57eca1a02..5834b2ecd 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -93,6 +93,9 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, quint32 toolId, QWidget connect(ui->comboBoxSpline, &QComboBox::currentTextChanged, this, &DialogCutSpline::SplineChanged); vis = new VisToolCutSpline(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -264,3 +267,15 @@ quint32 DialogCutSpline::getSplineId() const { return getCurrentObjectId(ui->comboBoxSpline); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSpline::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutSpline::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.h b/src/libs/vtools/dialogs/tools/dialogcutspline.h index 6d728b5f3..004baa916 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.h +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.h @@ -61,6 +61,9 @@ public: quint32 getSplineId() const; void setSplineId(quint32 value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.ui b/src/libs/vtools/dialogs/tools/dialogcutspline.ui index 50093ca7f..eb70a1e36 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.ui @@ -6,8 +6,8 @@ 0 0 - 412 - 189 + 324 + 240 @@ -17,235 +17,272 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Curve: - - - - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Curve: + + + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index 500c44bd4..2dadb3746 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -93,6 +93,9 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, quint32 toolId, connect(ui->comboBoxSplinePath, &QComboBox::currentTextChanged, this, &DialogCutSplinePath::SplinePathChanged); vis = new VisToolCutSplinePath(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -264,3 +267,15 @@ quint32 DialogCutSplinePath::getSplinePathId() const { return getCurrentObjectId(ui->comboBoxSplinePath); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSplinePath::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutSplinePath::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h index 2d08739b6..b6f26b3c0 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h @@ -61,6 +61,9 @@ public: quint32 getSplinePathId() const; void setSplinePathId(quint32 value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui index b17074fdf..bf2d6bf5f 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui @@ -6,8 +6,8 @@ 0 0 - 412 - 189 + 326 + 245 @@ -17,235 +17,272 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Curve: - - - - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Curve: + + + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp index 6c5a409a6..ba5ad6d2e 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp @@ -155,6 +155,9 @@ DialogEllipticalArc::DialogEllipticalArc(const VContainer *data, quint32 toolId, this, &DialogEllipticalArc::DeployRotationAngleTextEdit); vis = new VisToolEllipticalArc(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -588,3 +591,15 @@ void DialogEllipticalArc::closeEvent(QCloseEvent *event) ui->plainTextEditRotationAngle->blockSignals(true); DialogTool::closeEvent(event); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogEllipticalArc::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogEllipticalArc::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.h b/src/libs/vtools/dialogs/tools/dialogellipticalarc.h index 29f79bfd0..5fe122093 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.h +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.h @@ -74,6 +74,9 @@ public: QString GetColor() const; void SetColor(const QString &value); + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui b/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui index e9ac6f4a6..3d2594f93 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui @@ -6,8 +6,8 @@ 0 0 - 425 - 530 + 396 + 575 @@ -17,10 +17,16 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - + + + 0 + + + + Tool + @@ -1022,19 +1028,42 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + - - - - - Qt::Horizontal - - - QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - + + + + Notes + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp index 89f1e4801..f500fcbb6 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -123,6 +123,9 @@ DialogEndLine::DialogEndLine(const VContainer *data, quint32 toolId, QWidget *pa connect(timerFormulaAngle, &QTimer::timeout, this, &DialogEndLine::EvalAngle); vis = new VisToolEndLine(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -440,3 +443,15 @@ quint32 DialogEndLine::GetBasePointId() const { return getCurrentObjectId(ui->comboBoxBasePoint); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogEndLine::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogEndLine::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogendline.h b/src/libs/vtools/dialogs/tools/dialogendline.h index 0bea4593c..8dc68fb60 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.h +++ b/src/libs/vtools/dialogs/tools/dialogendline.h @@ -71,6 +71,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void ShowDialog(bool click) override; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; diff --git a/src/libs/vtools/dialogs/tools/dialogendline.ui b/src/libs/vtools/dialogs/tools/dialogendline.ui index a7692854c..ac58763eb 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.ui +++ b/src/libs/vtools/dialogs/tools/dialogendline.ui @@ -6,8 +6,8 @@ 0 0 - 358 - 331 + 326 + 376 @@ -26,496 +26,533 @@ - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - 0 - 0 - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - - 4 - 0 - - - - Calculation - - - true - - - QPlainTextEdit::NoWrap - - - - - - - - 16 - 16 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - 0 - 0 - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - - 4 - 0 - - - - Calculation - - - true - - - QPlainTextEdit::NoWrap - - - - - - - - 16 - 16 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Base point: - - - - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - Type of line: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - - 0 - 0 - - - - Line color: - - - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + 0 + 0 + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + + 4 + 0 + + + + Calculation + + + true + + + QPlainTextEdit::NoWrap + + + + + + + + 16 + 16 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + 0 + 0 + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + + 4 + 0 + + + + Calculation + + + true + + + QPlainTextEdit::NoWrap + + + + + + + + 16 + 16 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Base point: + + + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + Type of line: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + + 0 + 0 + + + + Line color: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp index e370fc820..0f5d6d7d6 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp @@ -88,6 +88,9 @@ DialogFlippingByAxis::DialogFlippingByAxis(const VContainer *data, quint32 toolI this, &DialogFlippingByAxis::PointChanged); vis = new VisToolFlippingByAxis(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -402,3 +405,15 @@ void DialogFlippingByAxis::FillComboBoxAxisType(QComboBox *box) box->addItem(tr("Vertical axis"), QVariant(static_cast(AxisType::VerticalAxis))); box->addItem(tr("Horizontal axis"), QVariant(static_cast(AxisType::HorizontalAxis))); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByAxis::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogFlippingByAxis::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h index 234261fe0..4f62e5004 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h @@ -74,6 +74,9 @@ public: void SetVisibilityGroupTags(const QStringList &tags); QStringList GetVisibilityGroupTags() const; + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void SetGroupCategories(const QStringList &categories) override; virtual void ShowDialog(bool click) override; diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui index 9ebf2e47f..df35b0448 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui @@ -7,100 +7,141 @@ 0 0 304 - 237 + 296 Flipping by axis - + + + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + - - - - - Origin point: - - - - - - - - - - Suffix: - - - - - - - - - - Axis type: - - - - - - - - - - - - Enable to create a visibility gropup from original objects + + + 0 - - Visibility Group - - - true - - - false - - - - - - Name: - - - - - - - Flipping by axis - - - true - - - - - - - Tags: - - - - - - - Separate each tag with comma. - - - Add tags - - - true - - - - + + + Tool + + + + + + + + Origin point: + + + + + + + + + + Suffix: + + + + + + + + + + Axis type: + + + + + + + + + + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Name: + + + + + + + Flipping by axis + + + true + + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + @@ -122,7 +163,9 @@
vlineedit.h
- + + + buttonBox diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp index 9532bd364..6c050756a 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp @@ -88,6 +88,9 @@ DialogFlippingByLine::DialogFlippingByLine(const VContainer *data, quint32 toolI this, &DialogFlippingByLine::PointChanged); vis = new VisToolFlippingByLine(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -430,3 +433,15 @@ void DialogFlippingByLine::PointChanged() CheckState(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByLine::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogFlippingByLine::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.h b/src/libs/vtools/dialogs/tools/dialogflippingbyline.h index 27a4314a2..a00139c81 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.h +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.h @@ -74,6 +74,9 @@ public: void SetVisibilityGroupTags(const QStringList &tags); QStringList GetVisibilityGroupTags() const; + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void SetGroupCategories(const QStringList &categories) override; virtual void ShowDialog(bool click) override; diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui b/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui index 788368f5c..41d39c969 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui @@ -6,8 +6,8 @@ 0 0 - 304 - 237 + 319 + 301 @@ -17,94 +17,131 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - First line point: - - - - - - - - - - Suffix: - - - - - - - - - - Second line point: - - - - - - - - - - - - Enable to create a visibility gropup from original objects + + + 0 - - Visibility Group - - - true - - - false - - - - - - Name: - - - - - - - Flipping by line - - - true - - - - - - - Tags: - - - - - - - Separate each tag with comma. - - - Add tags - - - true - - - - + + + Tool + + + + + + + + First line point: + + + + + + + + + + Suffix: + + + + + + + + + + Second line point: + + + + + + + + + + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Name: + + + + + + + Flipping by line + + + true + + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogheight.cpp b/src/libs/vtools/dialogs/tools/dialogheight.cpp index 21f676a06..de5fca452 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.cpp +++ b/src/libs/vtools/dialogs/tools/dialogheight.cpp @@ -90,6 +90,9 @@ DialogHeight::DialogHeight(const VContainer *data, quint32 toolId, QWidget *pare this, &DialogHeight::PointNameChanged); vis = new VisToolHeight(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -344,3 +347,15 @@ quint32 DialogHeight::GetP2LineId() const { return getCurrentObjectId(ui->comboBoxP2Line); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogHeight::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogHeight::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogheight.h b/src/libs/vtools/dialogs/tools/dialogheight.h index c1f3fec5f..21e799fc5 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.h +++ b/src/libs/vtools/dialogs/tools/dialogheight.h @@ -70,6 +70,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void PointNameChanged() override; diff --git a/src/libs/vtools/dialogs/tools/dialogheight.ui b/src/libs/vtools/dialogs/tools/dialogheight.ui index 064eca26b..1b59e11f5 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.ui +++ b/src/libs/vtools/dialogs/tools/dialogheight.ui @@ -6,8 +6,8 @@ 0 0 - 355 - 245 + 384 + 281 @@ -22,124 +22,141 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 0 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - Base point: - - - - - - - - - - - 0 - 0 - - - - First point of line: - - - - - - - - - - - 0 - 0 - - - - Second point of line: - - - - - - - - - - Type of line: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Line color: - - - - - - - + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + Base point: + + + + + + + + + + + 0 + 0 + + + + First point of line: + + + + + + + + + + + 0 + 0 + + + + Second point of line: + + + + + + + + + + Type of line: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Line color: + + + + + + + + + + + Notes + + + + + + + + @@ -154,11 +171,6 @@ - lineEditNamePoint - comboBoxBasePoint - comboBoxP1Line - comboBoxP2Line - comboBoxLineType buttonBox diff --git a/src/libs/vtools/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp index 35bc9fb18..4bc9dec78 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogline.cpp @@ -72,6 +72,9 @@ DialogLine::DialogLine(const VContainer *data, quint32 toolId, QWidget *parent) this, &DialogLine::PointNameChanged); vis = new VisToolLine(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -239,3 +242,15 @@ QString DialogLine::GetTypeLine() const { return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLine::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogLine::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogline.h b/src/libs/vtools/dialogs/tools/dialogline.h index e4c08695c..5eef73b11 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.h +++ b/src/libs/vtools/dialogs/tools/dialogline.h @@ -64,6 +64,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void PointNameChanged() override; diff --git a/src/libs/vtools/dialogs/tools/dialogline.ui b/src/libs/vtools/dialogs/tools/dialogline.ui index 203ad8e17..b23272f76 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.ui +++ b/src/libs/vtools/dialogs/tools/dialogline.ui @@ -9,8 +9,8 @@ 0 0 - 300 - 179 + 350 + 213 @@ -28,120 +28,140 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 90 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - First point: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 90 - 0 - - - - Second point: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 90 - 0 - - - - Type of line: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Line color: - - - - - - - + + + + + 90 + 0 + + + + First point: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + 90 + 0 + + + + Second point: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + 90 + 0 + + + + Type of line: + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Line color: + + + + + + + + + + + Notes + + + + + + + +
@@ -156,9 +176,6 @@
- comboBoxFirstPoint - comboBoxSecondPoint - comboBoxLineType buttonBox diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp index 75c552583..39cfb0750 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp @@ -93,6 +93,9 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, quint32 toolId, this, &DialogLineIntersect::PointNameChanged); vis = new VisToolLineIntersect(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -403,3 +406,15 @@ quint32 DialogLineIntersect::GetP2Line2() const { return getCurrentObjectId(ui->comboBoxP2Line2); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLineIntersect::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogLineIntersect::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.h b/src/libs/vtools/dialogs/tools/dialoglineintersect.h index fcfbfa218..7c4b88bec 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.h +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.h @@ -67,6 +67,9 @@ public: QString GetPointName() const; void SetPointName(const QString &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; void PointChanged(); diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.ui b/src/libs/vtools/dialogs/tools/dialoglineintersect.ui index 54fb74999..0916be51d 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.ui +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.ui @@ -6,8 +6,8 @@ 0 0 - 375 - 196 + 401 + 280 @@ -20,108 +20,149 @@ - + - - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - - First line + + + 0 + + + Tool + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + + First line + + + + + + + + + 0 + 0 + + + + First point: + + + + + + + + + + Second point: + + + + + + + + + + + + + + + Second line + + + + + + + + + 0 + 0 + + + + First point: + + + + + + + + + + Second point: + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + - - - - - - - 0 - 0 - - - - First point: - - - - - - - - - - Second point: - - - - - - - - - - - - Second line - - - - - - - - - - 0 - 0 - - - - First point: - - - - - - - - - - Second point: - - - - - - - - diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp index bca3559d8..d5c6593e6 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp @@ -109,6 +109,9 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, quint32 this, &DialogLineIntersectAxis::PointNameChanged); vis = new VisToolLineIntersectAxis(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -412,3 +415,15 @@ void DialogLineIntersectAxis::closeEvent(QCloseEvent *event) ui->plainTextEditFormula->blockSignals(true); DialogTool::closeEvent(event); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLineIntersectAxis::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogLineIntersectAxis::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.h b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.h index 7dce34f0e..524d17d40 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.h +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.h @@ -72,6 +72,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void ShowDialog(bool click) override; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui index 894a72187..6b4ca5976 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui @@ -6,8 +6,8 @@ 0 0 - 457 - 321 + 340 + 357 @@ -17,327 +17,364 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - - 4 - 0 - - - - Calculation - - - true - - - QPlainTextEdit::NoWrap - - - - - - - - 16 - 16 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Axis point: - - - - - - - Axis Point - - - - - - - - 0 - 0 - - - - First line point: - - - - - - - First point of line - - - - - - - - 0 - 0 - - - - Second line point: - - - - - - - Second point of line - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - - 0 - 0 - - - - Unique label - - - Choose unique label. - - - - - - - Type of line: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - Show line from first point to this point - - - - 80 - 14 - - - - - - - - Line color: - - - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + + 4 + 0 + + + + Calculation + + + true + + + QPlainTextEdit::NoWrap + + + + + + + + 16 + 16 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Axis point: + + + + + + + Axis Point + + + + + + + + 0 + 0 + + + + First line point: + + + + + + + First point of line + + + + + + + + 0 + 0 + + + + Second line point: + + + + + + + Second point of line + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + + 0 + 0 + + + + Unique label + + + Choose unique label. + + + + + + + Type of line: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + Show line from first point to this point + + + + 80 + 14 + + + + + + + + Line color: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogmove.cpp b/src/libs/vtools/dialogs/tools/dialogmove.cpp index 0105f8e4b..43bcd90ec 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.cpp +++ b/src/libs/vtools/dialogs/tools/dialogmove.cpp @@ -146,6 +146,9 @@ DialogMove::DialogMove(const VContainer *data, quint32 toolId, QWidget *parent) vis = new VisToolMove(data); SetRotationOrigPointId(NULL_ID); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -634,3 +637,15 @@ void DialogMove::EvalLength() Eval(formulaData, flagLength); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogMove::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogMove::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogmove.h b/src/libs/vtools/dialogs/tools/dialogmove.h index 741d8d144..c67a4669e 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.h +++ b/src/libs/vtools/dialogs/tools/dialogmove.h @@ -79,6 +79,9 @@ public: void SetVisibilityGroupTags(const QStringList &tags); QStringList GetVisibilityGroupTags() const; + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void SetGroupCategories(const QStringList &categories) override; virtual void ShowDialog(bool click) override; diff --git a/src/libs/vtools/dialogs/tools/dialogmove.ui b/src/libs/vtools/dialogs/tools/dialogmove.ui index defd52ef1..c8bb1b2d0 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.ui +++ b/src/libs/vtools/dialogs/tools/dialogmove.ui @@ -6,8 +6,8 @@ 0 0 - 424 - 432 + 411 + 498 @@ -17,633 +17,670 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Rotation angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Suffix: - - - - - - - - - - Rotation origin point: - - - - - - - - - - - - Enable to create a visibility gropup from original objects - - - Visibility Group - - - true - - - false - - - - - - Name: - - - - - - - Move - - - true - - - - - - - Tags: - - - - - - - Separate each tag with comma. - - - Add tags - - - true - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Rotation angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Suffix: + + + + + + + + + + Rotation origin point: + + + + + + + + + + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Name: + + + + + + + Move + + + true + + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + @@ -659,16 +696,16 @@ - - VCompleterLineEdit - QLineEdit -
vlineedit.h
-
VPlainTextEdit QPlainTextEdit
vplaintextedit.h
+ + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
diff --git a/src/libs/vtools/dialogs/tools/dialognormal.cpp b/src/libs/vtools/dialogs/tools/dialognormal.cpp index 3c727291f..0e58b189d 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.cpp +++ b/src/libs/vtools/dialogs/tools/dialognormal.cpp @@ -114,6 +114,9 @@ DialogNormal::DialogNormal(const VContainer *data, quint32 toolId, QWidget *pare this, &DialogNormal::PointNameChanged); vis = new VisToolNormal(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -403,3 +406,15 @@ quint32 DialogNormal::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNormal::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogNormal::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialognormal.h b/src/libs/vtools/dialogs/tools/dialognormal.h index c13eff2f2..4d558f401 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.h +++ b/src/libs/vtools/dialogs/tools/dialognormal.h @@ -73,6 +73,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialognormal.ui b/src/libs/vtools/dialogs/tools/dialognormal.ui index bbb31fb48..154d3a852 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.ui +++ b/src/libs/vtools/dialogs/tools/dialognormal.ui @@ -6,8 +6,8 @@ 0 0 - 517 - 432 + 354 + 466 @@ -20,497 +20,534 @@ - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - First point: - - - - - - - - - - - 0 - 0 - - - - Second point: - - - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Additional angle degrees: - - - true - - - - - - - QLayout::SetMinimumSize - - - 29 - - - 6 - - - - - ... - - - - :/icon/32x32/arrowRight.png:/icon/32x32/arrowRight.png - - - - 32 - 32 - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + - - - - - 0 - 0 - - - - - 56 - 0 - - - - -360.000000000000000 - - - 360.000000000000000 - - + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + - - - - ... + + + + QFormLayout::ExpandingFieldsGrow - - - :/icon/32x32/arrowLeftUp.png:/icon/32x32/arrowLeftUp.png - - - - 32 - 32 - - - + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + First point: + + + + + + + + + + + 0 + 0 + + + + Second point: + + + + + + + - - - - ... - - - - :/icon/32x32/arrowRightUp.png:/icon/32x32/arrowRightUp.png - - - - 32 - 32 - - - + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Additional angle degrees: + + + true + + + + + + + QLayout::SetMinimumSize + + + 29 + + + 6 + + + + + ... + + + + :/icon/32x32/arrowRight.png:/icon/32x32/arrowRight.png + + + + 32 + 32 + + + + + + + + + 0 + 0 + + + + + 56 + 0 + + + + -360.000000000000000 + + + 360.000000000000000 + + + + + + + ... + + + + :/icon/32x32/arrowLeftUp.png:/icon/32x32/arrowLeftUp.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowRightUp.png:/icon/32x32/arrowRightUp.png + + + + 32 + 32 + + + + + + + + + 0 + 0 + + + + ... + + + + :/icon/32x32/arrowUp.png:/icon/32x32/arrowUp.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowLeft.png:/icon/32x32/arrowLeft.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowLeftDown.png:/icon/32x32/arrowLeftDown.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowDown.png:/icon/32x32/arrowDown.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowRightDown.png:/icon/32x32/arrowRightDown.png + + + + 32 + 32 + + + + + + + - - - - - 0 - 0 - + + + + QFormLayout::ExpandingFieldsGrow - - ... - - - - :/icon/32x32/arrowUp.png:/icon/32x32/arrowUp.png - - - - 32 - 32 - - - + + + + Type of line: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + + + + Line color: + + + + - - - - ... + + + + Qt::Vertical - - - :/icon/32x32/arrowLeft.png:/icon/32x32/arrowLeft.png - - + - 32 - 32 + 20 + 40 - - - - - - ... - - - - :/icon/32x32/arrowLeftDown.png:/icon/32x32/arrowLeftDown.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowDown.png:/icon/32x32/arrowDown.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowRightDown.png:/icon/32x32/arrowRightDown.png - - - - 32 - 32 - - - + - - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - Type of line: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - - - - Line color: - - - - + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp index 56b4316cc..40688c97f 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp @@ -64,6 +64,9 @@ DialogPointFromArcAndTangent::DialogPointFromArcAndTangent(const VContainer *dat }); vis = new VisToolPointFromArcAndTangent(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -198,3 +201,15 @@ void DialogPointFromArcAndTangent::SaveData() point->setCrossPoint(GetCrossCirclesPoint()); point->RefreshGeometry(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointFromArcAndTangent::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointFromArcAndTangent::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.h b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.h index 2f0c9ebcd..dc8fd5274 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.h +++ b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.h @@ -64,6 +64,9 @@ public: CrossCirclesPoint GetCrossCirclesPoint() const; void SetCrossCirclesPoint(CrossCirclesPoint p); + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui index 3a3d120a2..50f250570 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.ui @@ -6,8 +6,8 @@ 0 0 - 370 - 179 + 304 + 215 @@ -19,102 +19,122 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - Tangent point: - - - - - - - - 0 - 0 - - - - - 143 - 0 - - - - - - - - - 0 - 0 - - - - Arc: - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - Take: - - - - - - - + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + Tangent point: + + + + + + + + 0 + 0 + + + + + 143 + 0 + + + + + + + + + 0 + 0 + + + + Arc: + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + Take: + + + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp index cf7e656c1..ea86e1709 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -103,6 +103,9 @@ DialogPointFromCircleAndTangent::DialogPointFromCircleAndTangent(const VContaine &DialogPointFromCircleAndTangent::DeployCircleRadiusTextEdit); vis = new VisToolPointFromCircleAndTangent(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -330,3 +333,15 @@ void DialogPointFromCircleAndTangent::closeEvent(QCloseEvent *event) ui->plainTextEditRadius->blockSignals(true); DialogTool::closeEvent(event); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointFromCircleAndTangent::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointFromCircleAndTangent::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.h b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.h index 59ce26b5a..4783cb864 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.h +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.h @@ -67,6 +67,9 @@ public: CrossCirclesPoint GetCrossCirclesPoint() const; void SetCrossCirclesPoint(const CrossCirclesPoint &p); + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; void PointChanged(); diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui index f4fc8f5d1..cf91ae0d1 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui @@ -6,8 +6,8 @@ 0 0 - 430 - 255 + 365 + 298 @@ -17,284 +17,321 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Radius: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - Center of the circle: - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - - 0 - 0 - - - - Tangent point: - - - - - - - - 0 - 0 - - - - - 143 - 0 - - - - - - - - Take: - - - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Radius: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + Center of the circle: + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + + 0 + 0 + + + + Tangent point: + + + + + + + + 0 + 0 + + + + + 143 + 0 + + + + + + + + Take: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp index 36f303936..697708617 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp @@ -104,6 +104,9 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, quint32 toolI this, &DialogPointOfContact::PointNameChanged); vis = new VisToolPointOfContact(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -381,3 +384,15 @@ quint32 DialogPointOfContact::GetSecondPoint() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfContact::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfContact::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.h b/src/libs/vtools/dialogs/tools/dialogpointofcontact.h index 984be1a42..290f6812d 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.h @@ -68,6 +68,9 @@ public: quint32 GetSecondPoint() const; void SetSecondPoint(quint32 value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui b/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui index 7a5977d59..8808f4299 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui @@ -6,8 +6,8 @@ 0 0 - 498 - 255 + 348 + 295 @@ -20,315 +20,352 @@ - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Radius: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - Center of arc: - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - - 0 - 0 - - - - Top of the line: - - - - - - - - 0 - 0 - - - - - 143 - 0 - - - - - - - - - 0 - 0 - - - - End of the line: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Radius: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + Center of arc: + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + + 0 + 0 + + + + Top of the line: + + + + + + + + 0 + 0 + + + + + 143 + 0 + + + + + + + + + 0 + 0 + + + + End of the line: + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp index 089d9f224..4a44fcef3 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp @@ -78,6 +78,9 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, qui vis = new VisToolPointOfIntersection(data); vis->VisualMode(NULL_ID);//Show vertical axis + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -232,3 +235,15 @@ quint32 DialogPointOfIntersection::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersection::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersection::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersection.h b/src/libs/vtools/dialogs/tools/dialogpointofintersection.h index b347a02f3..c978c5380 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersection.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersection.h @@ -61,6 +61,9 @@ public: quint32 GetSecondPointId() const; void SetSecondPointId(quint32 value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void PointNameChanged() override; diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui index ce231b260..921a63f46 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersection.ui @@ -6,8 +6,8 @@ 0 0 - 340 - 146 + 304 + 194 @@ -19,78 +19,98 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - Point label: - - - - - - - - 0 - 0 - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - X: vertical point: - - - - - - - - - - - 0 - 0 - - - - Y: horizontal point: - - - - - - - + + + + + 0 + 0 + + + + Point label: + + + + + + + + 0 + 0 + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + X: vertical point: + + + + + + + + + + + 0 + 0 + + + + Y: horizontal point: + + + + + + + + + + + Notes + + + + + + + + @@ -105,9 +125,6 @@
- lineEditNamePoint - comboBoxFirstPoint - comboBoxSecondPoint buttonBox diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp index 01772e7d8..ff52a4d5f 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp @@ -71,6 +71,9 @@ DialogPointOfIntersectionArcs::DialogPointOfIntersectionArcs(const VContainer *d this, &DialogPointOfIntersectionArcs::ArcChanged); vis = new VisToolPointOfIntersectionArcs(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -221,3 +224,15 @@ void DialogPointOfIntersectionArcs::SaveData() point->setCrossPoint(GetCrossArcPoint()); point->RefreshGeometry(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionArcs::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersectionArcs::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.h b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.h index 833ec6d16..fdc244e78 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.h @@ -64,6 +64,9 @@ public: CrossCirclesPoint GetCrossArcPoint() const; void SetCrossArcPoint(CrossCirclesPoint p); + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void ArcChanged(); diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui index fa91fe168..bb6b99281 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.ui @@ -6,8 +6,8 @@ 0 0 - 300 - 179 + 304 + 212 @@ -19,76 +19,96 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - First arc: - - - - - - - - - - - 0 - 0 - - - - Second arc: - - - - - - - - - - Take: - - - - - - - + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + First arc: + + + + + + + + + + + 0 + 0 + + + + Second arc: + + + + + + + + + + Take: + + + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp index ee63bcc80..22abed150 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -123,6 +123,9 @@ DialogPointOfIntersectionCircles::DialogPointOfIntersectionCircles(const VContai &DialogPointOfIntersectionCircles::DeployCircle2RadiusTextEdit); vis = new VisToolPointOfIntersectionCircles(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -420,3 +423,15 @@ void DialogPointOfIntersectionCircles::closeEvent(QCloseEvent *event) ui->plainTextEditCircle2Radius->blockSignals(true); DialogTool::closeEvent(event); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionCircles::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersectionCircles::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.h b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.h index 4bdc8f8e9..0ae691ecf 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.h @@ -70,6 +70,9 @@ public: CrossCirclesPoint GetCrossCirclesPoint() const; void SetCrossCirclesPoint(const CrossCirclesPoint &p); + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; void PointChanged(); diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui index c0f453079..64db825df 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui @@ -6,8 +6,8 @@ 0 0 - 401 - 331 + 417 + 370 @@ -17,464 +17,501 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Radius of the first circle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Radius of the second circle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - Center of the first circle: - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - - 0 - 0 - - - - Center of the second circle: - - - - - - - - 0 - 0 - - - - - 143 - 0 - - - - - - - - Take: - - - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Radius of the first circle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Radius of the second circle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + Center of the first circle: + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + + 0 + 0 + + + + Center of the second circle: + + + + + + + + 0 + 0 + + + + + 143 + 0 + + + + + + + + Take: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp index 2e9c751bf..c82a21d75 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp @@ -74,6 +74,9 @@ DialogPointOfIntersectionCurves::DialogPointOfIntersectionCurves(const VContaine this, &DialogPointOfIntersectionCurves::CurveChanged); vis = new VisToolPointOfIntersectionCurves(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -248,3 +251,15 @@ void DialogPointOfIntersectionCurves::CurveChanged() ChangeColor(ui->labelCurve2, color); CheckState(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionCurves::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersectionCurves::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h index 903e9fa3d..734a4a35f 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h @@ -66,6 +66,9 @@ public: HCrossCurvesPoint GetHCrossPoint() const; void SetHCrossPoint(HCrossCurvesPoint hP); + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui index 4fb60acd9..202dce314 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui @@ -6,8 +6,8 @@ 0 0 - 285 - 212 + 304 + 242 @@ -19,96 +19,116 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - First curve: - - - - - - - - - - - - - - - 0 - 0 - - - - Second curve: - - - - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - - 0 - 0 - - - - Unique label - - - Choose unique label. - - - - - - - Vertical correction: - - - - - - - - - - Horizontal correction: - - - - - - - + + + + + 0 + 0 + + + + First curve: + + + + + + + + + + + + + + + 0 + 0 + + + + Second curve: + + + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + + 0 + 0 + + + + Unique label + + + Choose unique label. + + + + + + + Vertical correction: + + + + + + + + + + Horizontal correction: + + + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index 306477be9..4d64cb5a1 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -107,6 +107,9 @@ DialogRotation::DialogRotation(const VContainer *data, quint32 toolId, QWidget * this, &DialogRotation::PointChanged); vis = new VisToolRotation(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -504,3 +507,15 @@ void DialogRotation::EvalAngle() Eval(formulaData, flagAngle); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogRotation::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogRotation::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.h b/src/libs/vtools/dialogs/tools/dialogrotation.h index 89b1221d5..087736055 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.h +++ b/src/libs/vtools/dialogs/tools/dialogrotation.h @@ -72,6 +72,9 @@ public: void SetVisibilityGroupTags(const QStringList &tags); QStringList GetVisibilityGroupTags() const; + void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void SetGroupCategories(const QStringList &categories) override; virtual void ShowDialog(bool click) override; diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.ui b/src/libs/vtools/dialogs/tools/dialogrotation.ui index 84bc08968..238755e7f 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.ui +++ b/src/libs/vtools/dialogs/tools/dialogrotation.ui @@ -6,8 +6,8 @@ 0 0 - 392 - 282 + 304 + 338 @@ -17,264 +17,301 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - Origin Point: - - - - - - - - - - Suffix: - - - - - - - - - - - - Enable to create a visibility gropup from original objects + + + 0 - - Visibility Group - - - true - - - false - - - - - - Tags: - - - - - - - Rotation - - - true - - - - - - - Name: - - - - - - - Separate each tag with comma. - - - Add tags - - - true - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + Origin Point: + + + + + + + + + + Suffix: + + + + + + + + + + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Tags: + + + + + + + Rotation + + + true + + + + + + + Name: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + @@ -290,16 +327,16 @@ - - VCompleterLineEdit - QLineEdit -
vlineedit.h
-
VPlainTextEdit QPlainTextEdit
vplaintextedit.h
+ + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp index 8c8d6b5d4..b57ed59e0 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp @@ -106,6 +106,9 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, quint32 toolId, this, &DialogShoulderPoint::PointNameChanged); vis = new VisToolShoulderPoint(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -416,3 +419,15 @@ quint32 DialogShoulderPoint::GetP3() const { return getCurrentObjectId(ui->comboBoxP3); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogShoulderPoint::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogShoulderPoint::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.h b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.h index 0cbab3ea9..95d0f9fda 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.h +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.h @@ -73,6 +73,9 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; /** diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui index 7d95924c4..9e06473b0 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui @@ -6,8 +6,8 @@ 0 0 - 488 - 321 + 304 + 356 @@ -20,354 +20,391 @@ - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - - - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - First point: - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - - 0 - 0 - - - - Second point: - - - - - - - - 0 - 0 - - - - - 143 - 0 - - - - - - - - - 0 - 0 - - - - Third point: - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - - 0 - 0 - - - - Type of line: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Line color: - - - - - - - + + + Tool + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + First point: + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + + 0 + 0 + + + + Second point: + + + + + + + + 0 + 0 + + + + + 143 + 0 + + + + + + + + + 0 + 0 + + + + Third point: + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + + 0 + 0 + + + + Type of line: + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Line color: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp b/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp index b3f5e21c7..7a6f11dd8 100644 --- a/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp +++ b/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp @@ -62,6 +62,9 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, quint32 toolId, QWi CheckPointLabel(this, ui->lineEditName, ui->labelEditName, pointName, this->data, flagName); CheckState(); }); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -128,3 +131,15 @@ QString DialogSinglePoint::GetPointName() const { return pointName; } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSinglePoint::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSinglePoint::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogsinglepoint.h b/src/libs/vtools/dialogs/tools/dialogsinglepoint.h index 1536322fc..5d3fa2828 100644 --- a/src/libs/vtools/dialogs/tools/dialogsinglepoint.h +++ b/src/libs/vtools/dialogs/tools/dialogsinglepoint.h @@ -58,6 +58,9 @@ public: QString GetPointName() const; + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: void mousePress(const QPointF &scenePos); protected: diff --git a/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui b/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui index d8bd7b484..eecf0d912 100644 --- a/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui +++ b/src/libs/vtools/dialogs/tools/dialogsinglepoint.ui @@ -9,8 +9,8 @@ 0 0 - 300 - 202 + 329 + 244 @@ -28,71 +28,108 @@ - - - - - Unique label - - - - - - Choose unique label. - - - - - - - - 0 - 0 - - - - Point label - - - - - - - - - - 241 - 129 - + + + 0 - - Coordinates on the sheet - - - Coordinates - - - - - - Y coordinate - - - - - - - X coordinate - - - - - - - - - - + + + Tool + + + + + + + + Unique label + + + + + + Choose unique label. + + + + + + + + 0 + 0 + + + + Point label + + + + + + + + + + 241 + 129 + + + + Coordinates on the sheet + + + Coordinates + + + + + + Y coordinate + + + + + + + X coordinate + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Notes + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogspline.cpp b/src/libs/vtools/dialogs/tools/dialogspline.cpp index 0cda9f9da..a9abdb46e 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogspline.cpp @@ -156,6 +156,9 @@ DialogSpline::DialogSpline(const VContainer *data, quint32 toolId, QWidget *pare SCASSERT(scene != nullptr) connect(scene, &VMainGraphicsScene::MouseLeftPressed, path, &VisToolSpline::MouseLeftPressed); connect(scene, &VMainGraphicsScene::MouseLeftReleased, path, &VisToolSpline::MouseLeftReleased); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -597,3 +600,15 @@ void DialogSpline::SetSpline(const VSpline &spline) path->SetKCurve(spl.GetKcurve()); path->setApproximationScale(spl.GetApproximationScale()); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSpline::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSpline::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogspline.h b/src/libs/vtools/dialogs/tools/dialogspline.h index 75126bc06..214e26d39 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.h +++ b/src/libs/vtools/dialogs/tools/dialogspline.h @@ -58,6 +58,9 @@ public: VSpline GetSpline() const; void SetSpline(const VSpline &spline); + void SetNotes(const QString ¬es); + QString GetNotes() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void PointNameChanged() override; diff --git a/src/libs/vtools/dialogs/tools/dialogspline.ui b/src/libs/vtools/dialogs/tools/dialogspline.ui index 93693be1a..9a16011a9 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.ui +++ b/src/libs/vtools/dialogs/tools/dialogspline.ui @@ -6,8 +6,8 @@ 0 0 - 524 - 403 + 532 + 452 @@ -20,902 +20,939 @@ - + - - - + + + 0 + + + + Tool + + - + - + + + + + + + + 89 + 0 + + + + First point: + + + + + + + + 0 + 0 + + + + + + + + + + Control point + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + + + + + + + + + Second point: + + + + + + + + 0 + 0 + + + + + + + + + + Control point + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + Color: + + + + + + + + 0 + 0 + + + + + + + + Name: + + + + + + + true + + + + + + + Pen style: + + + + + - 89 + 80 0 - - First point: + + + 110 + 16777215 + + + + + 80 + 14 + - - - - - 0 - 0 - + + + + Approximation scale: + + + + + + + Set approximation scale for this curve, 0 - use global value + + + 1 + + + 10.000000000000000 + + + 0.100000000000000 - - - Control point + + + Qt::Vertical - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - + + + 20 + 0 + + + - - - + + + + Notes + + - - - - - Second point: - - - - - - - - 0 - 0 - - - - - - - - - - Control point - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - + - - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - Color: - - - - - - - - 0 - 0 - - - - - - - - Name: - - - - - - - true - - - - - - - Pen style: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Approximation scale: - - - - - - - Set approximation scale for this curve, 0 - use global value - - - 1 - - - 10.000000000000000 - - - 0.100000000000000 - - - - + + diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp index 232e2c6c3..8df77ebd6 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp @@ -133,6 +133,9 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, quint32 toolId, QWidg SCASSERT(scene != nullptr) connect(scene, &VMainGraphicsScene::MouseLeftPressed, path, &VisToolSplinePath::MouseLeftPressed); connect(scene, &VMainGraphicsScene::MouseLeftReleased, path, &VisToolSplinePath::MouseLeftReleased); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -944,3 +947,15 @@ bool DialogSplinePath::IsValid() const return fAngle1 && fAngle2 && fLength1 && fLength2 && flagError; } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSplinePath::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSplinePath::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.h b/src/libs/vtools/dialogs/tools/dialogsplinepath.h index fd1c16f34..ebd4b806b 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.h +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.h @@ -58,6 +58,9 @@ public: VSplinePath GetPath() const; void SetPath(const VSplinePath &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void ShowDialog(bool click) override; diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogsplinepath.ui index 4a8b461c7..8aabfe949 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.ui +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.ui @@ -6,8 +6,8 @@ 0 0 - 456 - 599 + 460 + 647 @@ -20,864 +20,901 @@ - + - - - + + + 0 + + + + Tool + + - + - - - Point: - - + + + + + + + Point: + + + + + + + + + + + + First control point + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + + + Second control point + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Length: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Angle: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Formula wizard + + + ... + + + + :/icon/24x24/fx.png:/icon/24x24/fx.png + + + + 24 + 24 + + + + + + + + + + + :/icon/24x24/equal.png + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value + + + _ + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + Calculation + + + true + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + .. + + + + 16 + 16 + + + + true + + + + + + + + + + + - + + + List of points + + - - - First control point + + + QFormLayout::ExpandingFieldsGrow - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - + + + + Color: + + + + + + + + + + Name: + + + + + + + true + + + + + + + Pen style: + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + + + + + + Approximation scale: + + + + + + + Set approximation scale for this curve, 0 - use global value + + + 1 + + + 10.000000000000000 + + + 0.100000000000000 + + + + - - - Second control point + + + Qt::Vertical - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Length: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Angle: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Formula wizard - - - ... - - - - :/icon/24x24/fx.png:/icon/24x24/fx.png - - - - 24 - 24 - - - - - - - - - - - :/icon/24x24/equal.png - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value - - - _ - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 28 - - - - Calculation - - - true - - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - .. - - - - 16 - 16 - - - - true - - - - - - - - - + + + 20 + 40 + + + - - - - - List of points - - - - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - Color: - - - - - - - - - - Name: - - - - - - - true - - - - - - - Pen style: - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - Approximation scale: - - - - - - - Set approximation scale for this curve, 0 - use global value - - - 1 - - - 10.000000000000000 - - - 0.100000000000000 - - - - + + + + Notes + + + + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogtriangle.cpp b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp index 4f2470c64..ecbbf3dbb 100644 --- a/src/libs/vtools/dialogs/tools/dialogtriangle.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp @@ -83,6 +83,9 @@ DialogTriangle::DialogTriangle(const VContainer *data, quint32 toolId, QWidget * this, &DialogTriangle::PointNameChanged); vis = new VisToolTriangle(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -331,3 +334,15 @@ quint32 DialogTriangle::GetSecondPointId() const { return getCurrentObjectId(ui->comboBoxSecondPoint); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogTriangle::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogTriangle::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogtriangle.h b/src/libs/vtools/dialogs/tools/dialogtriangle.h index 598b55add..f9930b00b 100644 --- a/src/libs/vtools/dialogs/tools/dialogtriangle.h +++ b/src/libs/vtools/dialogs/tools/dialogtriangle.h @@ -67,6 +67,9 @@ public: QString GetPointName() const; void SetPointName(const QString &value); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void PointNameChanged() override; diff --git a/src/libs/vtools/dialogs/tools/dialogtriangle.ui b/src/libs/vtools/dialogs/tools/dialogtriangle.ui index 532db8b6c..b98798636 100644 --- a/src/libs/vtools/dialogs/tools/dialogtriangle.ui +++ b/src/libs/vtools/dialogs/tools/dialogtriangle.ui @@ -6,8 +6,8 @@ 0 0 - 348 - 212 + 304 + 242 @@ -22,98 +22,118 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - Point label: - - - - - - - Unique label - - - Choose unique label. - - - - - - - - 0 - 0 - - - - First point of axis: - - - - - - - - - - - 0 - 0 - - - - Second point of axis: - - - - - - - - - - - 0 - 0 - - - - First point: - - - - - - - - - - - 0 - 0 - - - - Second point: - - - - - - - + + + + + 0 + 0 + + + + Point label: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + 0 + 0 + + + + First point of axis: + + + + + + + + + + + 0 + 0 + + + + Second point of axis: + + + + + + + + + + + 0 + 0 + + + + First point: + + + + + + + + + + + 0 + 0 + + + + Second point: + + + + + + + + + + + Notes + + + + + + + + @@ -128,11 +148,6 @@ - lineEditNamePoint - comboBoxAxisP1 - comboBoxAxisP2 - comboBoxFirstPoint - comboBoxSecondPoint buttonBox diff --git a/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp b/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp index db01cc06a..bab4f1658 100644 --- a/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp @@ -89,6 +89,9 @@ DialogTrueDarts::DialogTrueDarts(const VContainer *data, quint32 toolId, QWidget this, &DialogTrueDarts::PointNameChanged); vis = new VisToolTrueDarts(data); + + ui->tabWidget->setCurrentIndex(0); + SetTabStopDistance(ui->plainTextEditToolNotes); } //--------------------------------------------------------------------------------------------------------------------- @@ -426,3 +429,15 @@ void DialogTrueDarts::CheckName(QLineEdit *edit, QLabel *labelEditNamePoint, con ChangeColor(labelEditNamePoint, OkColor(this)); } } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogTrueDarts::SetNotes(const QString ¬es) +{ + ui->plainTextEditToolNotes->setPlainText(notes); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogTrueDarts::GetNotes() const +{ + return ui->plainTextEditToolNotes->toPlainText(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogtruedarts.h b/src/libs/vtools/dialogs/tools/dialogtruedarts.h index bed49f8fb..6843b740c 100644 --- a/src/libs/vtools/dialogs/tools/dialogtruedarts.h +++ b/src/libs/vtools/dialogs/tools/dialogtruedarts.h @@ -71,6 +71,9 @@ public: void SetThirdDartPointId(const quint32 &value); void SetChildrenId(const quint32 &ch1, const quint32 &ch2); + + void SetNotes(const QString ¬es); + QString GetNotes() const; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; virtual void PointNameChanged() override; diff --git a/src/libs/vtools/dialogs/tools/dialogtruedarts.ui b/src/libs/vtools/dialogs/tools/dialogtruedarts.ui index 9c94a1761..134d9c913 100644 --- a/src/libs/vtools/dialogs/tools/dialogtruedarts.ui +++ b/src/libs/vtools/dialogs/tools/dialogtruedarts.ui @@ -6,8 +6,8 @@ 0 0 - 372 - 278 + 304 + 308 @@ -19,138 +19,158 @@ - - - QFormLayout::ExpandingFieldsGrow + + + 0 - - - - - 0 - 0 - + + + Tool + + + + QFormLayout::ExpandingFieldsGrow - - First base point: - - - - - - - - - - - 0 - 0 - - - - Second base point: - - - - - - - - - - - 0 - 0 - - - - First dart point: - - - - - - - - - - Second dart point: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 80 - 14 - - - - - - - - Third dart point: - - - - - - - - - - - 0 - 0 - - - - First new dart point: - - - - - - - Unique label - - - Choose unique label. - - - - - - - Second new dart point: - - - - - - - Unique label - - - Choose unique label. - - - - + + + + + 0 + 0 + + + + First base point: + + + + + + + + + + + 0 + 0 + + + + Second base point: + + + + + + + + + + + 0 + 0 + + + + First dart point: + + + + + + + + + + Second dart point: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 80 + 14 + + + + + + + + Third dart point: + + + + + + + + + + + 0 + 0 + + + + First new dart point: + + + + + + + Unique label + + + Choose unique label. + + + + + + + Second new dart point: + + + + + + + Unique label + + + Choose unique label. + + + + + + + + Notes + + + + + + + +
diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp index ad59a898f..bf3f542ea 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp @@ -40,8 +40,8 @@ //--------------------------------------------------------------------------------------------------------------------- VAbstractFlipping::VAbstractFlipping(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &suffix, const QVector &source, const QVector &destination, - QGraphicsItem *parent) - : VAbstractOperation(doc, data, id, suffix, source, destination, parent) + const QString ¬es, QGraphicsItem *parent) + : VAbstractOperation(doc, data, id, suffix, source, destination, notes, parent) { } diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.h b/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.h index dcee6bbdc..7af3b971a 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.h +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.h @@ -40,7 +40,7 @@ public: virtual ~VAbstractFlipping() Q_DECL_EQ_DEFAULT; protected: VAbstractFlipping(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &suffix, - const QVector &source, const QVector &destination, + const QVector &source, const QVector &destination, const QString ¬es, QGraphicsItem *parent = nullptr); static void CreateDestination(VAbstractOperationInitData &initData, const QPointF &fPoint, const QPointF &sPoint); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index 66317733e..bcac26423 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -74,6 +74,7 @@ void VToolFlippingByAxis::setDialog() dialogTool->SetOriginPointId(m_originPointId); dialogTool->SetAxisType(m_axisType); dialogTool->SetSuffix(suffix); + dialogTool->SetNotes(m_notes); SetDialogVisibilityGroupData(dialogTool); } @@ -99,6 +100,7 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(const QPointer &dia initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolFlippingByAxis* operation = Create(initData); if (operation != nullptr) @@ -226,6 +228,9 @@ void VToolFlippingByAxis::SaveDialog(QDomElement &domElement, QList &ol doc->SetAttribute(domElement, AttrAxisType, QString().setNum(static_cast(dialogTool->GetAxisType()))); doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix()); + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + // Save visibility data for later use SaveVisibilityGroupData(dialogTool); } @@ -233,6 +238,8 @@ void VToolFlippingByAxis::SaveDialog(QDomElement &domElement, QList &ol //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByAxis::ReadToolAttributes(const QDomElement &domElement) { + VAbstractFlipping::ReadToolAttributes(domElement); + m_originPointId = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); m_axisType = static_cast(doc->GetParametrUInt(domElement, AttrAxisType, QChar('1'))); suffix = doc->GetParametrString(domElement, AttrSuffix); @@ -241,7 +248,7 @@ void VToolFlippingByAxis::ReadToolAttributes(const QDomElement &domElement) //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByAxis::SaveOptions(QDomElement &tag, QSharedPointer &obj) { - VDrawTool::SaveOptions(tag, obj); + VAbstractFlipping::SaveOptions(tag, obj); doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrCenter, QString().setNum(m_originPointId)); @@ -263,7 +270,7 @@ QString VToolFlippingByAxis::MakeToolTip() const //--------------------------------------------------------------------------------------------------------------------- VToolFlippingByAxis::VToolFlippingByAxis(const VToolFlippingByAxisInitData &initData, QGraphicsItem *parent) : VAbstractFlipping(initData.doc, initData.data, initData.id, initData.suffix, initData.source, - initData.destination, parent), + initData.destination, initData.notes, parent), m_originPointId(initData.originPointId), m_axisType(initData.axisType) { diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index e2bda983b..5c70ec11b 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -74,6 +74,7 @@ void VToolFlippingByLine::setDialog() dialogTool->SetFirstLinePointId(m_firstLinePointId); dialogTool->SetSecondLinePointId(m_secondLinePointId); dialogTool->SetSuffix(suffix); + dialogTool->SetNotes(m_notes); SetDialogVisibilityGroupData(dialogTool); } @@ -99,6 +100,7 @@ VToolFlippingByLine *VToolFlippingByLine::Create(const QPointer &dia initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolFlippingByLine* operation = Create(initData); if (operation != nullptr) @@ -213,6 +215,9 @@ void VToolFlippingByLine::SaveDialog(QDomElement &domElement, QList &ol doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondLinePointId())); doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix()); + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + // Save visibility data for later use SaveVisibilityGroupData(dialogTool); } @@ -220,6 +225,8 @@ void VToolFlippingByLine::SaveDialog(QDomElement &domElement, QList &ol //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByLine::ReadToolAttributes(const QDomElement &domElement) { + VAbstractFlipping::ReadToolAttributes(domElement); + m_firstLinePointId = doc->GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); m_secondLinePointId = doc->GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); suffix = doc->GetParametrString(domElement, AttrSuffix); @@ -228,7 +235,7 @@ void VToolFlippingByLine::ReadToolAttributes(const QDomElement &domElement) //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) { - VDrawTool::SaveOptions(tag, obj); + VAbstractFlipping::SaveOptions(tag, obj); doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrP1Line, QString().setNum(m_firstLinePointId)); @@ -252,7 +259,7 @@ QString VToolFlippingByLine::MakeToolTip() const //--------------------------------------------------------------------------------------------------------------------- VToolFlippingByLine::VToolFlippingByLine(const VToolFlippingByLineInitData &initData, QGraphicsItem *parent) : VAbstractFlipping(initData.doc, initData.data, initData.id, initData.suffix, initData.source, - initData.destination, parent), + initData.destination, initData.notes, parent), m_firstLinePointId(initData.firstLinePointId), m_secondLinePointId(initData.secondLinePointId) { diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 434741545..0a284f22b 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -522,8 +522,8 @@ void VAbstractOperation::LabelChangePosition(const QPointF &pos, quint32 labelId //--------------------------------------------------------------------------------------------------------------------- VAbstractOperation::VAbstractOperation(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &suffix, const QVector &source, const QVector &destination, - QGraphicsItem *parent) - : VDrawTool(doc, data, id), + const QString ¬es, QGraphicsItem *parent) + : VDrawTool(doc, data, id, notes), QGraphicsLineItem(parent), suffix(suffix), source(source), diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h index ce120c4d8..57eb6ff06 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h @@ -50,10 +50,10 @@ struct DestinationItem bool showLabel; }; -struct VAbstractOperationInitData : VAbstractToolInitData +struct VAbstractOperationInitData : VDrawToolInitData { VAbstractOperationInitData() - : VAbstractToolInitData() + : VDrawToolInitData() {} QString suffix{}; @@ -139,7 +139,7 @@ protected: VAbstractOperation(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &suffix, const QVector &source, const QVector &destination, - QGraphicsItem *parent = nullptr); + const QString ¬es, QGraphicsItem *parent = nullptr); virtual void AddToFile() override; virtual void ChangeLabelVisibility(quint32 id, bool visible) override; diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index 37621d7a7..df6489f4e 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -128,6 +128,7 @@ void VToolMove::setDialog() dialogTool->SetLength(formulaLength); dialogTool->SetSuffix(suffix); dialogTool->SetRotationOrigPointId(origPointId); + dialogTool->SetNotes(m_notes); SetDialogVisibilityGroupData(dialogTool); } @@ -155,6 +156,7 @@ VToolMove *VToolMove::Create(const QPointer &dialog, VMainGraphicsSc initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolMove* operation = Create(initData); if (operation != nullptr) @@ -482,6 +484,9 @@ void VToolMove::SaveDialog(QDomElement &domElement, QList &oldDependenc doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetRotationOrigPointId())); doc->SetAttribute(domElement, AttrRotationAngle, dialogTool->GetRotationAngle()); + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + // Save visibility data for later use SaveVisibilityGroupData(dialogTool); } @@ -489,6 +494,8 @@ void VToolMove::SaveDialog(QDomElement &domElement, QList &oldDependenc //--------------------------------------------------------------------------------------------------------------------- void VToolMove::ReadToolAttributes(const QDomElement &domElement) { + VAbstractOperation::ReadToolAttributes(domElement); + origPointId = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); formulaAngle = doc->GetParametrString(domElement, AttrAngle, QChar('0')); formulaRotationAngle = doc->GetParametrString(domElement, AttrRotationAngle, QChar('0')); @@ -499,7 +506,7 @@ void VToolMove::ReadToolAttributes(const QDomElement &domElement) //--------------------------------------------------------------------------------------------------------------------- void VToolMove::SaveOptions(QDomElement &tag, QSharedPointer &obj) { - VDrawTool::SaveOptions(tag, obj); + VAbstractOperation::SaveOptions(tag, obj); doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrAngle, formulaAngle); @@ -534,7 +541,7 @@ QString VToolMove::MakeToolTip() const //--------------------------------------------------------------------------------------------------------------------- VToolMove::VToolMove(const VToolMoveInitData &initData, QGraphicsItem *parent) : VAbstractOperation(initData.doc, initData.data, initData.id, initData.suffix, initData.source, - initData.destination, parent), + initData.destination, initData.notes, parent), formulaAngle(initData.formulaAngle), formulaRotationAngle(initData.formulaRotationAngle), formulaLength(initData.formulaLength), diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index b03cc7048..7506c7077 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -81,7 +81,7 @@ const QString VToolRotation::ToolType = QStringLiteral("rotation"); //--------------------------------------------------------------------------------------------------------------------- VToolRotation::VToolRotation(const VToolRotationInitData &initData, QGraphicsItem *parent) : VAbstractOperation(initData.doc, initData.data, initData.id, initData.suffix, initData.source, - initData.destination, parent), + initData.destination, initData.notes, parent), origPointId(initData.origin), formulaAngle(initData.angle) { @@ -98,6 +98,7 @@ void VToolRotation::setDialog() dialogTool->SetOrigPointId(origPointId); dialogTool->SetAngle(formulaAngle); dialogTool->SetSuffix(suffix); + dialogTool->SetNotes(m_notes); SetDialogVisibilityGroupData(dialogTool); } @@ -123,6 +124,7 @@ VToolRotation *VToolRotation::Create(const QPointer &dialog, VMainGr initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolRotation* operation = Create(initData); if (operation != nullptr) @@ -362,6 +364,9 @@ void VToolRotation::SaveDialog(QDomElement &domElement, QList &oldDepen doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix()); + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + // Save visibility data for later use SaveVisibilityGroupData(dialogTool); } @@ -369,6 +374,8 @@ void VToolRotation::SaveDialog(QDomElement &domElement, QList &oldDepen //--------------------------------------------------------------------------------------------------------------------- void VToolRotation::ReadToolAttributes(const QDomElement &domElement) { + VAbstractOperation::ReadToolAttributes(domElement); + origPointId = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); formulaAngle = doc->GetParametrString(domElement, AttrAngle, QChar('0')); suffix = doc->GetParametrString(domElement, AttrSuffix); @@ -377,7 +384,7 @@ void VToolRotation::ReadToolAttributes(const QDomElement &domElement) //--------------------------------------------------------------------------------------------------------------------- void VToolRotation::SaveOptions(QDomElement &tag, QSharedPointer &obj) { - VDrawTool::SaveOptions(tag, obj); + VAbstractOperation::SaveOptions(tag, obj); doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrCenter, QString().setNum(origPointId)); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp index 39963cb20..155b055d3 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp @@ -55,8 +55,9 @@ #include "../vdrawtool.h" //--------------------------------------------------------------------------------------------------------------------- -VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent) - :VDrawTool(doc, data, id), +VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, + QGraphicsItem *parent) + :VDrawTool(doc, data, id, notes), QGraphicsPathItem(parent), controlPoints(), sceneType(SceneObject::Unknown), @@ -322,12 +323,6 @@ void VAbstractSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) QGraphicsPathItem::mouseReleaseEvent(event); } -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractSpline::ReadToolAttributes(const QDomElement &domElement) -{ - Q_UNUSED(domElement) -} - //--------------------------------------------------------------------------------------------------------------------- void VAbstractSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) { @@ -508,8 +503,9 @@ void VAbstractSpline::GroupVisibility(quint32 object, bool visible) // VToolAbstractArc //--------------------------------------------------------------------------------------------------------------------- -VToolAbstractArc::VToolAbstractArc(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent) - : VAbstractSpline(doc, data, id, parent) +VToolAbstractArc::VToolAbstractArc(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, + QGraphicsItem *parent) + : VAbstractSpline(doc, data, id, notes, parent) {} //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h index f5f286175..83b8ddf99 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h @@ -54,10 +54,10 @@ class VControlPointSpline; template class QSharedPointer; -struct VAbstractSplineInitData : VAbstractToolInitData +struct VAbstractSplineInitData : VDrawToolInitData { VAbstractSplineInitData() - : VAbstractToolInitData(), + : VDrawToolInitData(), color(ColorBlack), penStyle(TypeLineLine), approximationScale(defCurveApproximationScale) @@ -72,7 +72,8 @@ class VAbstractSpline:public VDrawTool, public QGraphicsPathItem { Q_OBJECT public: - VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr); + VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, + QGraphicsItem * parent = nullptr); virtual ~VAbstractSpline() Q_DECL_EQ_DEFAULT; virtual QPainterPath shape() const override; @@ -129,7 +130,6 @@ protected: virtual void keyReleaseEvent(QKeyEvent * event) override; virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override; virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) override; - virtual void ReadToolAttributes(const QDomElement &domElement) override; virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj) override; virtual void RefreshCtrlPoints(); virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) override; @@ -250,7 +250,8 @@ void VAbstractSpline::InitElArcToolConnections(VMainGraphicsScene *scene, T *too class VToolAbstractArc:public VAbstractSpline { public: - VToolAbstractArc(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent = nullptr); + VToolAbstractArc(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, + QGraphicsItem *parent = nullptr); virtual ~VToolAbstractArc() = default; QString CenterPointName() const; diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp index 801137749..c18d7d323 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp @@ -64,7 +64,7 @@ const QString VToolArc::ToolType = QStringLiteral("simple"); * @param initData init data */ VToolArc::VToolArc(const VToolArcInitData &initData, QGraphicsItem *parent) - : VToolAbstractArc(initData.doc, initData.data, initData.id, parent) + : VToolAbstractArc(initData.doc, initData.data, initData.id, initData.notes, parent) { sceneType = SceneObject::Arc; @@ -90,6 +90,7 @@ void VToolArc::setDialog() dialogTool->SetColor(arc->GetColor()); dialogTool->SetPenStyle(arc->GetPenStyle()); dialogTool->SetApproximationScale(arc->GetApproximationScale()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -120,6 +121,7 @@ VToolArc* VToolArc::Create(const QPointer &dialog, VMainGraphicsScen initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; initData.approximationScale = dialogTool->GetApproximationScale(); + initData.notes = dialogTool->GetNotes(); VToolArc* point = Create(initData); if (point != nullptr) @@ -336,6 +338,9 @@ void VToolArc::SaveDialog(QDomElement &domElement, QList &oldDependenci doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); doc->SetAttribute(domElement, AttrPenStyle, dialogTool->GetPenStyle()); doc->SetAttribute(domElement, AttrAScale, dialogTool->GetApproximationScale()); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp index dfa297148..46014c9a2 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp @@ -60,7 +60,7 @@ const QString VToolArcWithLength::ToolType = QStringLiteral("arcWithLength"); //--------------------------------------------------------------------------------------------------------------------- VToolArcWithLength::VToolArcWithLength(const VToolArcWithLengthInitData &initData, QGraphicsItem *parent) - :VToolAbstractArc(initData.doc, initData.data, initData.id, parent) + :VToolAbstractArc(initData.doc, initData.data, initData.id, initData.notes, parent) { sceneType = SceneObject::Arc; @@ -83,6 +83,7 @@ void VToolArcWithLength::setDialog() dialogTool->SetColor(arc->GetColor()); dialogTool->SetPenStyle(arc->GetPenStyle()); dialogTool->SetApproximationScale(arc->GetApproximationScale()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -106,6 +107,7 @@ VToolArcWithLength *VToolArcWithLength::Create(const QPointer &dialo initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolArcWithLength* point = Create(initData); if (point != nullptr) @@ -315,6 +317,9 @@ void VToolArcWithLength::SaveDialog(QDomElement &domElement, QList &old doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); doc->SetAttribute(domElement, AttrPenStyle, dialogTool->GetPenStyle()); doc->SetAttribute(domElement, AttrAScale, dialogTool->GetApproximationScale()); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp index 32eb7958f..61456c494 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp @@ -58,7 +58,7 @@ const QString VToolCubicBezier::ToolType = QStringLiteral("cubicBezier"); //--------------------------------------------------------------------------------------------------------------------- VToolCubicBezier::VToolCubicBezier(const VToolCubicBezierInitData &initData, QGraphicsItem *parent) - :VAbstractSpline(initData.doc, initData.data, initData.id, parent) + :VAbstractSpline(initData.doc, initData.data, initData.id, initData.notes, parent) { sceneType = SceneObject::Spline; @@ -75,6 +75,7 @@ void VToolCubicBezier::setDialog() SCASSERT(dialogTool != nullptr) const auto spl = VAbstractTool::data.GeometricObject(m_id); dialogTool->SetSpline(*spl); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -92,6 +93,7 @@ VToolCubicBezier *VToolCubicBezier::Create(const QPointer &dialog, V initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; initData.spline = new VCubicBezier(dialogTool->GetSpline()); + initData.notes = dialogTool->GetNotes(); auto* spl = Create(initData); @@ -231,6 +233,9 @@ void VToolCubicBezier::SaveDialog(QDomElement &domElement, QList &oldDe AddDependence(newDependencies, spl.GetP3().id()); AddDependence(newDependencies, spl.GetP4().id()); + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + SetSplineAttributes(domElement, spl); } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h index 457dcf64f..442ec4432 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h @@ -46,10 +46,10 @@ template class QSharedPointer; QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") -struct VToolCubicBezierInitData : VAbstractToolInitData +struct VToolCubicBezierInitData : VDrawToolInitData { VToolCubicBezierInitData() - : VAbstractToolInitData(), + : VDrawToolInitData(), spline(nullptr) {} diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp index e0b57f1a0..174717407 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp @@ -60,7 +60,7 @@ const QString VToolCubicBezierPath::ToolType = QStringLiteral("cubicBezierPath") //--------------------------------------------------------------------------------------------------------------------- VToolCubicBezierPath::VToolCubicBezierPath(const VToolCubicBezierPathInitData &initData, QGraphicsItem *parent) - : VAbstractSpline(initData.doc, initData.data, initData.id, parent) + : VAbstractSpline(initData.doc, initData.data, initData.id, initData.notes, parent) { sceneType = SceneObject::SplinePath; @@ -77,6 +77,7 @@ void VToolCubicBezierPath::setDialog() SCASSERT(dialogTool != nullptr) const QSharedPointer splPath = VAbstractTool::data.GeometricObject(m_id); dialogTool->SetPath(*splPath); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -93,6 +94,7 @@ VToolCubicBezierPath *VToolCubicBezierPath::Create(const QPointer &d initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); initData.path = new VCubicBezierPath(dialogTool->GetPath()); for (qint32 i = 0; i < initData.path->CountPoints(); ++i) @@ -217,6 +219,9 @@ void VToolCubicBezierPath::SaveDialog(QDomElement &domElement, QList &o AddDependence(newDependencies, splPath.at(i).id()); } + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + SetSplinePathAttributes(domElement, splPath); } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h index f272b5939..b2799f9a9 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h @@ -46,10 +46,10 @@ template class QSharedPointer; QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") -struct VToolCubicBezierPathInitData : VAbstractToolInitData +struct VToolCubicBezierPathInitData : VDrawToolInitData { VToolCubicBezierPathInitData() - : VAbstractToolInitData(), + : VDrawToolInitData(), path(nullptr) {} diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index 556faf696..00be5b2b8 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -65,7 +65,7 @@ const QString VToolEllipticalArc::ToolType = QStringLiteral("simple"); * @param parent parent object */ VToolEllipticalArc::VToolEllipticalArc(const VToolEllipticalArcInitData &initData, QGraphicsItem *parent) - :VToolAbstractArc(initData.doc, initData.data, initData.id, parent) + :VToolAbstractArc(initData.doc, initData.data, initData.id, initData.notes, parent) { sceneType = SceneObject::ElArc; @@ -92,6 +92,7 @@ void VToolEllipticalArc::setDialog() dialogTool->SetRotationAngle(elArc->GetFormulaRotationAngle()); dialogTool->SetColor(elArc->GetColor()); dialogTool->SetPenStyle(elArc->GetPenStyle()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -123,6 +124,7 @@ VToolEllipticalArc* VToolEllipticalArc::Create(const QPointer &dialo initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); //initData.approximationScale = dialogTool->GetApproximationScale(); // For future use VToolEllipticalArc* point = Create(initData); @@ -383,6 +385,9 @@ void VToolEllipticalArc::SaveDialog(QDomElement &domElement, QList &old doc->SetAttribute(domElement, AttrRotationAngle, dialogTool->GetRotationAngle()); doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); doc->SetAttribute(domElement, AttrPenStyle, dialogTool->GetPenStyle()); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index 1dc7a3407..60d6abf7b 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -77,7 +77,7 @@ const QString VToolSpline::OldToolType = QStringLiteral("simple"); * @param parent parent object. */ VToolSpline::VToolSpline(const VToolSplineInitData &initData, QGraphicsItem *parent) - : VAbstractSpline(initData.doc, initData.data, initData.id, parent), + : VAbstractSpline(initData.doc, initData.data, initData.id, initData.notes, parent), oldPosition(), moved(false), oldMoveSpline(), @@ -131,6 +131,7 @@ void VToolSpline::setDialog() SCASSERT(not dialogTool.isNull()) const auto spl = VAbstractTool::data.GeometricObject(m_id); dialogTool->SetSpline(*spl); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -155,6 +156,7 @@ VToolSpline* VToolSpline::Create(const QPointer &dialog, VMainGraphi initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); auto spl = Create(initData, new VSpline(dialogTool->GetSpline())); @@ -338,6 +340,9 @@ void VToolSpline::SaveDialog(QDomElement &domElement, QList &oldDepende controlPoints[0]->blockSignals(false); controlPoints[1]->blockSignals(false); + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + SetSplineAttributes(domElement, spl); } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index ebdab5e21..ffccde2eb 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -83,7 +83,7 @@ const QString VToolSplinePath::OldToolType = QStringLiteral("path"); * @param parent parent object. */ VToolSplinePath::VToolSplinePath(const VToolSplinePathInitData &initData, QGraphicsItem *parent) - : VAbstractSpline(initData.doc, initData.data, initData.id, parent), + : VAbstractSpline(initData.doc, initData.data, initData.id, initData.notes, parent), oldPosition(), splIndex(-1), moved(false), @@ -166,6 +166,7 @@ void VToolSplinePath::setDialog() SCASSERT(not dialogTool.isNull()) const QSharedPointer splPath = VAbstractTool::data.GeometricObject(m_id); dialogTool->SetPath(*splPath); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -189,6 +190,7 @@ VToolSplinePath* VToolSplinePath::Create(const QPointer &dialog, VMa initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VSplinePath *path = new VSplinePath(dialogTool->GetPath()); for (qint32 i = 0; i < path->CountPoints(); ++i) @@ -536,6 +538,9 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement, QList &oldDep controlPoints[j-1]->blockSignals(false); } + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); + SetSplinePathAttributes(domElement, splPath); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp index e4100d3d0..1192a5037 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp @@ -55,8 +55,8 @@ //--------------------------------------------------------------------------------------------------------------------- VToolDoublePoint::VToolDoublePoint(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 p1id, quint32 p2id, - QGraphicsItem *parent) - :VAbstractPoint(doc, data, id), + const QString ¬es, QGraphicsItem *parent) + :VAbstractPoint(doc, data, id, notes), QGraphicsPathItem(parent), firstPoint(nullptr), secondPoint(nullptr), diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h index 708ab4471..e3fe3f8c9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h @@ -49,7 +49,7 @@ class VToolDoublePoint: public VAbstractPoint, public QGraphicsPathItem Q_OBJECT public: VToolDoublePoint(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 p1id, quint32 p2id, - QGraphicsItem * parent = nullptr); + const QString ¬es, QGraphicsItem * parent = nullptr); virtual ~VToolDoublePoint() Q_DECL_EQ_DEFAULT; virtual int type() const override {return Type;} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index 8f9e93924..74fa8a91e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -57,7 +57,7 @@ const QString VToolTrueDarts::ToolType = QStringLiteral("trueDarts"); //--------------------------------------------------------------------------------------------------------------------- VToolTrueDarts::VToolTrueDarts(const VToolTrueDartsInitData &initData, QGraphicsItem *parent) - :VToolDoublePoint(initData.doc, initData.data, initData.id, initData.p1id, initData.p2id, parent), + :VToolDoublePoint(initData.doc, initData.data, initData.id, initData.p1id, initData.p2id, initData.notes, parent), baseLineP1Id (initData.baseLineP1Id), baseLineP2Id(initData.baseLineP2Id), dartP1Id(initData.dartP1Id), @@ -108,6 +108,7 @@ void VToolTrueDarts::setDialog() dialogTool->SetFirstDartPointId(dartP1Id); dialogTool->SetSecondDartPointId(dartP2Id); dialogTool->SetThirdDartPointId(dartP3Id); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -131,6 +132,7 @@ VToolTrueDarts *VToolTrueDarts::Create(const QPointer &dialog, VMain initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolTrueDarts *point = Create(initData); if (point != nullptr) @@ -288,6 +290,9 @@ void VToolTrueDarts::SaveDialog(QDomElement &domElement, QList &oldDepe doc->SetAttribute(domElement, AttrDartP1, QString().setNum(dialogTool->GetFirstDartPointId())); doc->SetAttribute(domElement, AttrDartP2, QString().setNum(dialogTool->GetSecondDartPointId())); doc->SetAttribute(domElement, AttrDartP3, QString().setNum(dialogTool->GetThirdDartPointId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -306,6 +311,8 @@ void VToolTrueDarts::SaveOptions(QDomElement &tag, QSharedPointer &obj //--------------------------------------------------------------------------------------------------------------------- void VToolTrueDarts::ReadToolAttributes(const QDomElement &domElement) { + VToolDoublePoint::ReadToolAttributes(domElement); + baseLineP1Id = doc->GetParametrUInt(domElement, AttrBaseLineP1, NULL_ID_STR); baseLineP2Id = doc->GetParametrUInt(domElement, AttrBaseLineP2, NULL_ID_STR); dartP1Id = doc->GetParametrUInt(domElement, AttrDartP1, NULL_ID_STR); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h index a2c33077d..0d97b7505 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h @@ -44,10 +44,10 @@ template class QSharedPointer; -struct VToolTrueDartsInitData : VAbstractToolInitData +struct VToolTrueDartsInitData : VDrawToolInitData { VToolTrueDartsInitData() - : VAbstractToolInitData(), + : VDrawToolInitData(), p1id(NULL_ID), p2id(NULL_ID), baseLineP1Id(NULL_ID), diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp index f0de213d4..d20aac17c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp @@ -45,8 +45,8 @@ //--------------------------------------------------------------------------------------------------------------------- VToolCut::VToolCut(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &curveCutId, QGraphicsItem *parent) - : VToolSinglePoint(doc, data, id, parent), + const quint32 &curveCutId, const QString ¬es, QGraphicsItem *parent) + : VToolSinglePoint(doc, data, id, notes, parent), formula(formula), curveCutId(curveCutId), detailsMode(qApp->Settings()->IsShowCurveDetails()) @@ -78,7 +78,7 @@ void VToolCut::FullUpdateFromFile() } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolCut::GetFormula() const +VFormula VToolCut::GetFormulaLength() const { VFormula val(formula, getData()); val.setCheckZero(true); @@ -89,7 +89,7 @@ VFormula VToolCut::GetFormula() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolCut::SetFormula(const VFormula &value) +void VToolCut::SetFormulaLength(const VFormula &value) { if (value.error() == false) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h index b9d4dd15e..7dfff48e6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h @@ -50,12 +50,12 @@ class VToolCut : public VToolSinglePoint Q_OBJECT public: VToolCut(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &curveCutId, QGraphicsItem * parent = nullptr); + const quint32 &curveCutId, const QString ¬es, QGraphicsItem * parent = nullptr); virtual int type() const override {return Type;} enum { Type = UserType + static_cast(Tool::Cut)}; - VFormula GetFormula() const; - void SetFormula(const VFormula &value); + VFormula GetFormulaLength() const; + void SetFormulaLength(const VFormula &value); QString CurveName() const; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index 9231b893d..6fa112a1b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -63,7 +63,7 @@ const QString VToolCutArc::ToolType = QStringLiteral("cutArc"); * @param parent parent object. */ VToolCutArc::VToolCutArc(const VToolCutArcInitData &initData, QGraphicsItem * parent) - :VToolCut(initData.doc, initData.data, initData.id, initData.formula, initData.arcId, parent) + :VToolCut(initData.doc, initData.data, initData.id, initData.formula, initData.arcId, initData.notes, parent) { ToolCreation(initData.typeCreation); } @@ -81,6 +81,7 @@ void VToolCutArc::setDialog() dialogTool->SetFormula(formula); dialogTool->setArcId(curveCutId); dialogTool->SetPointName(point->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -107,6 +108,7 @@ VToolCutArc* VToolCutArc::Create(const QPointer &dialog, VMainGraphi initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolCutArc* point = Create(initData); if (point != nullptr) @@ -216,6 +218,9 @@ void VToolCutArc::SaveDialog(QDomElement &domElement, QList &oldDepende doc->SetAttribute(domElement, AttrName, dialogTool->GetPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -231,6 +236,8 @@ void VToolCutArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolCutArc::ReadToolAttributes(const QDomElement &domElement) { + VToolCut::ReadToolAttributes(domElement); + formula = doc->GetParametrString(domElement, AttrLength, QString()); curveCutId = doc->GetParametrUInt(domElement, AttrArc, NULL_ID_STR); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp index 9e056c490..3c7308148 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -66,7 +66,7 @@ const QString VToolCutSpline::AttrSpline = QStringLiteral("spline"); * @param parent parent object. */ VToolCutSpline::VToolCutSpline(const VToolCutSplineInitData &initData, QGraphicsItem *parent) - :VToolCut(initData.doc, initData.data, initData.id, initData.formula, initData.splineId, parent) + :VToolCut(initData.doc, initData.data, initData.id, initData.formula, initData.splineId, initData.notes, parent) { ToolCreation(initData.typeCreation); } @@ -84,6 +84,7 @@ void VToolCutSpline::setDialog() dialogTool->SetFormula(formula); dialogTool->setSplineId(curveCutId); dialogTool->SetPointName(point->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -110,6 +111,7 @@ VToolCutSpline* VToolCutSpline::Create(const QPointer &dialog, VMain initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolCutSpline* point = Create(initData); if (point != nullptr) @@ -215,6 +217,9 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement, QList &oldDepe doc->SetAttribute(domElement, AttrName, dialogTool->GetPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -230,6 +235,8 @@ void VToolCutSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj //--------------------------------------------------------------------------------------------------------------------- void VToolCutSpline::ReadToolAttributes(const QDomElement &domElement) { + VToolCut::ReadToolAttributes(domElement); + formula = doc->GetParametrString(domElement, AttrLength, QString()); curveCutId = doc->GetParametrUInt(domElement, AttrSpline, NULL_ID_STR); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index d37b00fa2..f184679cc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -69,7 +69,7 @@ const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath"); * @param parent parent object. */ VToolCutSplinePath::VToolCutSplinePath(const VToolCutSplinePathInitData &initData, QGraphicsItem *parent) - :VToolCut(initData.doc, initData.data, initData.id, initData.formula, initData.splinePathId, parent) + :VToolCut(initData.doc, initData.data, initData.id, initData.formula, initData.splinePathId, initData.notes, parent) { ToolCreation(initData.typeCreation); } @@ -87,6 +87,7 @@ void VToolCutSplinePath::setDialog() dialogTool->SetFormula(formula); dialogTool->setSplinePathId(curveCutId); dialogTool->SetPointName(point->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -113,6 +114,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const QPointer &dialo initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolCutSplinePath* point = Create(initData); if (point != nullptr) @@ -306,6 +308,9 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement, QList &old doc->SetAttribute(domElement, AttrName, dialogTool->GetPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -321,6 +326,8 @@ void VToolCutSplinePath::SaveOptions(QDomElement &tag, QSharedPointer //--------------------------------------------------------------------------------------------------------------------- void VToolCutSplinePath::ReadToolAttributes(const QDomElement &domElement) { + VToolCut::ReadToolAttributes(domElement); + formula = doc->GetParametrString(domElement, AttrLength, QString()); curveCutId = doc->GetParametrUInt(domElement, AttrSplinePath, NULL_ID_STR); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp index 9e1cffc36..6d2da01ac 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -66,7 +66,7 @@ const QString VToolAlongLine::ToolType = QStringLiteral("alongLine"); */ VToolAlongLine::VToolAlongLine(const VToolAlongLineInitData &initData, QGraphicsItem *parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, initData.formula, - initData.firstPointId, 0, parent), + initData.firstPointId, 0, initData.notes, parent), secondPointId(initData.secondPointId) { ToolCreation(initData.typeCreation); @@ -105,6 +105,9 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement, QList &oldDepe doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->GetFirstPointId()); doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->GetSecondPointId()); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -121,6 +124,8 @@ void VToolAlongLine::SaveOptions(QDomElement &tag, QSharedPointer &obj //--------------------------------------------------------------------------------------------------------------------- void VToolAlongLine::ReadToolAttributes(const QDomElement &domElement) { + VToolLinePoint::ReadToolAttributes(domElement); + m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); formulaLength = doc->GetParametrString(domElement, AttrLength, QString()); @@ -207,6 +212,7 @@ void VToolAlongLine::setDialog() dialogTool->SetFirstPointId(basePointId); dialogTool->SetSecondPointId(secondPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -236,6 +242,7 @@ VToolAlongLine* VToolAlongLine::Create(const QPointer &dialog, VMain initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolAlongLine *point = Create(initData); if (point != nullptr) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp index f64b32ae5..c3a2597f0 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp @@ -63,7 +63,7 @@ const QString VToolBisector::ToolType = QStringLiteral("bisector"); */ VToolBisector::VToolBisector(const VToolBisectorInitData &initData, QGraphicsItem *parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, initData.formula, - initData.secondPointId, 0, parent), + initData.secondPointId, 0, initData.notes, parent), firstPointId(initData.firstPointId), thirdPointId(initData.thirdPointId) { @@ -122,6 +122,7 @@ void VToolBisector::setDialog() dialogTool->SetSecondPointId(basePointId); dialogTool->SetThirdPointId(thirdPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -152,6 +153,7 @@ VToolBisector* VToolBisector::Create(const QPointer &dialog, VMainGr initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolBisector *point = Create(initData); if (point != nullptr) @@ -261,6 +263,9 @@ void VToolBisector::SaveDialog(QDomElement &domElement, QList &oldDepen doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->GetThirdPointId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -278,6 +283,8 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolBisector::ReadToolAttributes(const QDomElement &domElement) { + VToolLinePoint::ReadToolAttributes(domElement); + m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); formulaLength = doc->GetParametrString(domElement, AttrLength, QString()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index 1ea2ef245..b8f4b6cb6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -74,7 +74,7 @@ const QString VToolCurveIntersectAxis::ToolType = QStringLiteral("curveIntersect VToolCurveIntersectAxis::VToolCurveIntersectAxis(const VToolCurveIntersectAxisInitData &initData, QGraphicsItem *parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, QString(), - initData.basePointId, 0, parent), + initData.basePointId, 0, initData.notes, parent), formulaAngle(initData.formulaAngle), curveId(initData.curveId) { @@ -95,6 +95,7 @@ void VToolCurveIntersectAxis::setDialog() dialogTool->SetBasePointId(basePointId); dialogTool->setCurveId(curveId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -118,6 +119,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const QPointerGetNotes(); VToolCurveIntersectAxis *point = Create(initData); if (point != nullptr) @@ -262,6 +264,9 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement, QList doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -278,6 +283,8 @@ void VToolCurveIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerGetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp index 319cd5fa8..a937939c9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp @@ -64,7 +64,7 @@ const QString VToolEndLine::ToolType = QStringLiteral("endLine"); */ VToolEndLine::VToolEndLine(const VToolEndLineInitData &initData, QGraphicsItem *parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, - initData.formulaLength, initData.basePointId, 0, parent), + initData.formulaLength, initData.basePointId, 0, initData.notes, parent), formulaAngle(initData.formulaAngle) { ToolCreation(initData.typeCreation); @@ -87,6 +87,7 @@ void VToolEndLine::setDialog() dialogTool->SetAngle(formulaAngle); dialogTool->SetBasePointId(basePointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -117,6 +118,7 @@ VToolEndLine* VToolEndLine::Create(const QPointer &dialog, VMainGrap initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolEndLine *point = Create(initData); if (point != nullptr) @@ -190,6 +192,9 @@ void VToolEndLine::SaveDialog(QDomElement &domElement, QList &oldDepend doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -206,6 +211,8 @@ void VToolEndLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolEndLine::ReadToolAttributes(const QDomElement &domElement) { + VToolLinePoint::ReadToolAttributes(domElement); + m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); formulaLength = doc->GetParametrString(domElement, AttrLength, QString()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp index 40c28fd76..71deadfa3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp @@ -60,7 +60,7 @@ const QString VToolHeight::ToolType = QStringLiteral("height"); */ VToolHeight::VToolHeight(const VToolHeightInitData &initData, QGraphicsItem * parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, QString(), - initData.basePointId, 0, parent), + initData.basePointId, 0, initData.notes, parent), p1LineId(initData.p1LineId), p2LineId(initData.p2LineId) { @@ -83,6 +83,7 @@ void VToolHeight::setDialog() dialogTool->SetP1LineId(p1LineId); dialogTool->SetP2LineId(p2LineId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -113,6 +114,7 @@ VToolHeight* VToolHeight::Create(const QPointer &dialog, VMainGraphi initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolHeight *point = Create(initData); if (point != nullptr) @@ -221,6 +223,9 @@ void VToolHeight::SaveDialog(QDomElement &domElement, QList &oldDepende doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1LineId())); doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2LineId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -237,6 +242,8 @@ void VToolHeight::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolHeight::ReadToolAttributes(const QDomElement &domElement) { + VToolLinePoint::ReadToolAttributes(domElement); + m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp index a154972ba..84d8b3830 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -60,7 +60,7 @@ const QString VToolLineIntersectAxis::ToolType = QStringLiteral("lineIntersectAx //--------------------------------------------------------------------------------------------------------------------- VToolLineIntersectAxis::VToolLineIntersectAxis(const VToolLineIntersectAxisInitData &initData, QGraphicsItem *parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, QString(), - initData.basePointId, 0, parent), + initData.basePointId, 0, initData.notes, parent), formulaAngle(initData.formulaAngle), firstPointId(initData.firstPointId), secondPointId(initData.secondPointId) @@ -83,6 +83,7 @@ void VToolLineIntersectAxis::setDialog() dialogTool->SetFirstPointId(firstPointId); dialogTool->SetSecondPointId(secondPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -106,6 +107,7 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const QPointerGetNotes(); VToolLineIntersectAxis *point = Create(initData); if (point != nullptr) @@ -279,6 +281,9 @@ void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement, QList doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstPointId())); doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondPointId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -296,6 +301,8 @@ void VToolLineIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerGetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp index eff502941..6725ad7cc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp @@ -67,8 +67,8 @@ template class QSharedPointer; */ VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &basePointId, - const qreal &angle, QGraphicsItem *parent) - :VToolSinglePoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId), + const qreal &angle, const QString ¬es, QGraphicsItem *parent) + :VToolSinglePoint(doc, data, id, notes, parent), formulaLength(formula), angle(angle), basePointId(basePointId), mainLine(nullptr), lineColor(lineColor) { this->m_lineType = typeLine; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h index e30241bd7..ba1f7ae37 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h @@ -63,7 +63,7 @@ class VToolLinePoint : public VToolSinglePoint public: VToolLinePoint(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, - QGraphicsItem * parent = nullptr); + const QString ¬es, QGraphicsItem * parent = nullptr); virtual ~VToolLinePoint() override; virtual int type() const override {return Type;} enum { Type = UserType + static_cast(Tool::LinePoint)}; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp index 664574778..ff2bf7437 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -64,7 +64,7 @@ const QString VToolNormal::ToolType = QStringLiteral("normal"); */ VToolNormal::VToolNormal(const VToolNormalInitData &initData, QGraphicsItem *parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, initData.formula, - initData.firstPointId, initData.angle, parent), + initData.firstPointId, initData.angle, initData.notes, parent), secondPointId(initData.secondPointId) { @@ -88,6 +88,7 @@ void VToolNormal::setDialog() dialogTool->SetFirstPointId(basePointId); dialogTool->SetSecondPointId(secondPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -118,6 +119,7 @@ VToolNormal* VToolNormal::Create(const QPointer &dialog, VMainGraphi initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolNormal *point = Create(initData); if (point != nullptr) @@ -232,6 +234,9 @@ void VToolNormal::SaveDialog(QDomElement &domElement, QList &oldDepende doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->GetAngle())); doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -249,6 +254,8 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolNormal::ReadToolAttributes(const QDomElement &domElement) { + VToolLinePoint::ReadToolAttributes(domElement); + m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); formulaLength = doc->GetParametrString(domElement, AttrLength, QString()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp index bd87e2e88..895f95edb 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp @@ -66,7 +66,7 @@ const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder"); */ VToolShoulderPoint::VToolShoulderPoint(const VToolShoulderPointInitData &initData, QGraphicsItem * parent) :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, initData.formula, - initData.p1Line, 0, parent), + initData.p1Line, 0, initData.notes, parent), p2Line(initData.p2Line), pShoulder(initData.pShoulder) { @@ -90,6 +90,7 @@ void VToolShoulderPoint::setDialog() dialogTool->SetP2Line(p2Line); dialogTool->SetP3(pShoulder); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -166,6 +167,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const QPointer &dialo initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolShoulderPoint * point = Create(initData); if (point != nullptr) @@ -279,6 +281,9 @@ void VToolShoulderPoint::SaveDialog(QDomElement &domElement, QList &old doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1Line())); doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2Line())); doc->SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogTool->GetP3())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -296,6 +301,8 @@ void VToolShoulderPoint::SaveOptions(QDomElement &tag, QSharedPointer //--------------------------------------------------------------------------------------------------------------------- void VToolShoulderPoint::ReadToolAttributes(const QDomElement &domElement) { + VToolLinePoint::ReadToolAttributes(domElement); + m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); formulaLength = doc->GetParametrString(domElement, AttrLength, QString()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index b49d2c546..f2bd56923 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -76,7 +76,8 @@ const QString VToolBasePoint::ToolType = QStringLiteral("single"); * @param parent parent object. */ VToolBasePoint::VToolBasePoint (const VToolBasePointInitData &initData, QGraphicsItem * parent ) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), namePP(initData.nameActivPP) + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), + namePP(initData.nameActivPP) { m_baseColor = Qt::red; this->setFlag(QGraphicsItem::ItemIsMovable, true); @@ -96,6 +97,7 @@ void VToolBasePoint::setDialog() SCASSERT(not dialogTool.isNull()) const QSharedPointer p = VAbstractTool::data.GeometricObject(m_id); dialogTool->SetData(p->name(), static_cast(*p)); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -267,6 +269,9 @@ void VToolBasePoint::SaveDialog(QDomElement &domElement, QList &oldDepe doc->SetAttribute(domElement, AttrName, name); doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x()))); doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(p.y()))); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -320,13 +325,6 @@ void VToolBasePoint::SaveOptions(QDomElement &tag, QSharedPointer &obj doc->SetAttribute(tag, AttrY, qApp->fromPixel(point->y())); } -//--------------------------------------------------------------------------------------------------------------------- -void VToolBasePoint::ReadToolAttributes(const QDomElement &domElement) -{ - Q_UNUSED(domElement) - // This tool doesn't need read attributes from file. -} - //--------------------------------------------------------------------------------------------------------------------- QString VToolBasePoint::MakeToolTip() const { @@ -374,8 +372,9 @@ void VToolBasePoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quin /** * @brief FullUpdateFromFile update tool data form file. */ -void VToolBasePoint::FullUpdateFromFile() +void VToolBasePoint::FullUpdateFromFile() { + ReadAttributes(); RefreshPointGeometry(*VAbstractTool::data.GeometricObject(m_id)); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h index 740dd63f7..1b8bfbffe 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h @@ -95,7 +95,6 @@ protected: virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ) override; virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) override; virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj) override; - virtual void ReadToolAttributes(const QDomElement &domElement) override; virtual void SetVisualization() override {} virtual QString MakeToolTip() const override; private slots: diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index 5a34b2776..995acdaa5 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -64,7 +64,7 @@ const QString VToolLineIntersect::ToolType = QStringLiteral("lineIntersect"); * @param parent parent object. */ VToolLineIntersect::VToolLineIntersect(const VToolLineIntersectInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), p1Line1(initData.p1Line1Id), p2Line1(initData.p2Line1Id), p1Line2(initData.p1Line2Id), @@ -88,6 +88,7 @@ void VToolLineIntersect::setDialog() dialogTool->SetP1Line2(p1Line2); dialogTool->SetP2Line2(p2Line2); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -117,6 +118,7 @@ VToolLineIntersect* VToolLineIntersect::Create(const QPointer &dialo initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolLineIntersect* point = Create(initData); if (point != nullptr) @@ -259,6 +261,9 @@ void VToolLineIntersect::SaveDialog(QDomElement &domElement, QList &old doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->GetP2Line1())); doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->GetP1Line2())); doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->GetP2Line2())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -276,6 +281,8 @@ void VToolLineIntersect::SaveOptions(QDomElement &tag, QSharedPointer //--------------------------------------------------------------------------------------------------------------------- void VToolLineIntersect::ReadToolAttributes(const QDomElement &domElement) { + VToolSinglePoint::ReadToolAttributes(domElement); + p1Line1 = doc->GetParametrUInt(domElement, AttrP1Line1, NULL_ID_STR); p2Line1 = doc->GetParametrUInt(domElement, AttrP2Line1, NULL_ID_STR); p1Line2 = doc->GetParametrUInt(domElement, AttrP1Line2, NULL_ID_STR); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index f99b82692..e4004777c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -58,7 +58,7 @@ const QString VToolPointFromArcAndTangent::ToolType = QStringLiteral("pointFromA //--------------------------------------------------------------------------------------------------------------------- VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(const VToolPointFromArcAndTangentInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), arcId(initData.arcId), tangentPointId(initData.tangentPointId), crossPoint(initData.crossPoint) @@ -77,6 +77,7 @@ void VToolPointFromArcAndTangent::setDialog() dialogTool->SetCrossCirclesPoint(crossPoint); dialogTool->SetTangentPointId(tangentPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -98,6 +99,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(const QPointer< initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolPointFromArcAndTangent *point = Create(initData); if (point != nullptr) @@ -298,6 +300,9 @@ void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement, QListSetAttribute(domElement, AttrTangent, QString().setNum(dialogTool->GetTangentPointId())); doc->SetAttribute(domElement, AttrCrossPoint, QString().setNum(static_cast(dialogTool->GetCrossCirclesPoint()))); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -314,6 +319,8 @@ void VToolPointFromArcAndTangent::SaveOptions(QDomElement &tag, QSharedPointerGetParametrUInt(domElement, AttrArc, NULL_ID_STR); tangentPointId = doc->GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index 230df2356..19fb58a80 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -59,7 +59,7 @@ const QString VToolPointFromCircleAndTangent::ToolType = QStringLiteral("pointFr //--------------------------------------------------------------------------------------------------------------------- VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(const VToolPointFromCircleAndTangentInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), circleCenterId(initData.circleCenterId), tangentPointId(initData.tangentPointId), circleRadius(initData.circleRadius), @@ -81,6 +81,7 @@ void VToolPointFromCircleAndTangent::setDialog() dialogTool->SetCrossCirclesPoint(crossPoint); dialogTool->SetTangentPointId(tangentPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -104,6 +105,7 @@ VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(const QPo initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolPointFromCircleAndTangent *point = Create(initData); if (point != nullptr) @@ -290,6 +292,9 @@ void VToolPointFromCircleAndTangent::SaveDialog(QDomElement &domElement, QListSetAttribute(domElement, AttrCRadius, dialogTool->GetCircleRadius()); doc->SetAttribute(domElement, AttrCrossPoint, QString().setNum(static_cast(dialogTool->GetCrossCirclesPoint()))); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -307,6 +312,8 @@ void VToolPointFromCircleAndTangent::SaveOptions(QDomElement &tag, QSharedPointe //--------------------------------------------------------------------------------------------------------------------- void VToolPointFromCircleAndTangent::ReadToolAttributes(const QDomElement &domElement) { + VToolSinglePoint::ReadToolAttributes(domElement); + circleCenterId = doc->GetParametrUInt(domElement, AttrCCenter, NULL_ID_STR); tangentPointId = doc->GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); circleRadius = doc->GetParametrString(domElement, AttrCRadius); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp index 9aa1ad7ac..56d0f0aa5 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp @@ -68,7 +68,7 @@ const QString VToolPointOfContact::ToolType = QStringLiteral("pointOfContact"); * @param parent parent object. */ VToolPointOfContact::VToolPointOfContact(const VToolPointOfContactInitData &initData, QGraphicsItem *parent) - : VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + : VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), arcRadius(initData.radius), center(initData.center), firstPointId(initData.firstPointId), @@ -92,6 +92,7 @@ void VToolPointOfContact::setDialog() dialogTool->SetFirstPoint(firstPointId); dialogTool->SetSecondPoint(secondPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -184,6 +185,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const QPointer &dia initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolPointOfContact *point = Create(initData); if (point != nullptr) @@ -313,6 +315,9 @@ void VToolPointOfContact::SaveDialog(QDomElement &domElement, QList &ol doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter())); doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -330,6 +335,8 @@ void VToolPointOfContact::SaveOptions(QDomElement &tag, QSharedPointer //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfContact::ReadToolAttributes(const QDomElement &domElement) { + VToolSinglePoint::ReadToolAttributes(domElement); + arcRadius = doc->GetParametrString(domElement, AttrRadius, QString()); center = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp index 76692a5fe..c6c1d6c4f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp @@ -61,7 +61,7 @@ const QString VToolPointOfIntersection::ToolType = QStringLiteral("pointOfInters */ VToolPointOfIntersection::VToolPointOfIntersection(const VToolPointOfIntersectionInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), firstPointId(initData.firstPointId), secondPointId(initData.secondPointId) { @@ -81,6 +81,7 @@ void VToolPointOfIntersection::setDialog() dialogTool->SetFirstPointId(firstPointId); dialogTool->SetSecondPointId(secondPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -109,6 +110,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const QPointerGetNotes(); VToolPointOfIntersection *point = Create(initData); if (point != nullptr) @@ -205,6 +207,9 @@ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement, QListSetAttribute(domElement, AttrName, dialogTool->GetPointName()); doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -220,6 +225,8 @@ void VToolPointOfIntersection::SaveOptions(QDomElement &tag, QSharedPointerGetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index 081c3b8d4..36b830b2d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -58,7 +58,7 @@ const QString VToolPointOfIntersectionArcs::ToolType = QStringLiteral("pointOfIn //--------------------------------------------------------------------------------------------------------------------- VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(const VToolPointOfIntersectionArcsInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), firstArcId(initData.firstArcId), secondArcId(initData.secondArcId), crossPoint(initData.pType) @@ -77,6 +77,7 @@ void VToolPointOfIntersectionArcs::setDialog() dialogTool->SetSecondArcId(secondArcId); dialogTool->SetCrossArcPoint(crossPoint); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -98,6 +99,7 @@ VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(const QPointe initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolPointOfIntersectionArcs *point = Create(initData); if (point != nullptr) @@ -319,6 +321,9 @@ void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement, QListSetAttribute(domElement, AttrFirstArc, QString().setNum(dialogTool->GetFirstArcId())); doc->SetAttribute(domElement, AttrSecondArc, QString().setNum(dialogTool->GetSecondArcId())); doc->SetAttribute(domElement, AttrCrossPoint, QString().setNum(static_cast(dialogTool->GetCrossArcPoint()))); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -335,6 +340,8 @@ void VToolPointOfIntersectionArcs::SaveOptions(QDomElement &tag, QSharedPointer< //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionArcs::ReadToolAttributes(const QDomElement &domElement) { + VToolSinglePoint::ReadToolAttributes(domElement); + firstArcId = doc->GetParametrUInt(domElement, AttrFirstArc, NULL_ID_STR); secondArcId = doc->GetParametrUInt(domElement, AttrSecondArc, NULL_ID_STR); crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index 80cd70d7c..164031486 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -59,7 +59,7 @@ const QString VToolPointOfIntersectionCircles::ToolType = QStringLiteral("pointO //--------------------------------------------------------------------------------------------------------------------- VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles( const VToolPointOfIntersectionCirclesInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), firstCircleCenterId(initData.firstCircleCenterId), secondCircleCenterId(initData.secondCircleCenterId), firstCircleRadius(initData.firstCircleRadius), @@ -83,6 +83,7 @@ void VToolPointOfIntersectionCircles::setDialog() dialogTool->SetSecondCircleRadius(secondCircleRadius); dialogTool->SetCrossCirclesPoint(crossPoint); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -107,6 +108,7 @@ VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(const Q initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolPointOfIntersectionCircles *point = Create(initData); if (point != nullptr) @@ -329,6 +331,9 @@ void VToolPointOfIntersectionCircles::SaveDialog(QDomElement &domElement, QList< doc->SetAttribute(domElement, AttrC2Radius, dialogTool->GetSecondCircleRadius()); doc->SetAttribute(domElement, AttrCrossPoint, QString().setNum(static_cast(dialogTool->GetCrossCirclesPoint()))); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -347,6 +352,8 @@ void VToolPointOfIntersectionCircles::SaveOptions(QDomElement &tag, QSharedPoint //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionCircles::ReadToolAttributes(const QDomElement &domElement) { + VToolSinglePoint::ReadToolAttributes(domElement); + firstCircleCenterId = doc->GetParametrUInt(domElement, AttrC1Center, NULL_ID_STR); secondCircleCenterId = doc->GetParametrUInt(domElement, AttrC2Center, NULL_ID_STR); firstCircleRadius = doc->GetParametrString(domElement, AttrC1Radius); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index 9927b79d0..c9178c162 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -58,7 +58,7 @@ const QString VToolPointOfIntersectionCurves::ToolType = QStringLiteral("pointOf //--------------------------------------------------------------------------------------------------------------------- VToolPointOfIntersectionCurves::VToolPointOfIntersectionCurves(const VToolPointOfIntersectionCurvesInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), firstCurveId(initData.firstCurveId), secondCurveId(initData.secondCurveId), vCrossPoint(initData.vCrossPoint), @@ -79,6 +79,7 @@ void VToolPointOfIntersectionCurves::setDialog() dialogTool->SetVCrossPoint(vCrossPoint); dialogTool->SetHCrossPoint(hCrossPoint); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -102,6 +103,7 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(const QPo initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolPointOfIntersectionCurves *point = Create(initData); if (point != nullptr) @@ -368,6 +370,9 @@ void VToolPointOfIntersectionCurves::SaveDialog(QDomElement &domElement, QListSetAttribute(domElement, AttrCurve2, QString().setNum(dialogTool->GetSecondCurveId())); doc->SetAttribute(domElement, AttrVCrossPoint, QString().setNum(static_cast(dialogTool->GetVCrossPoint()))); doc->SetAttribute(domElement, AttrHCrossPoint, QString().setNum(static_cast(dialogTool->GetHCrossPoint()))); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -385,6 +390,8 @@ void VToolPointOfIntersectionCurves::SaveOptions(QDomElement &tag, QSharedPointe //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionCurves::ReadToolAttributes(const QDomElement &domElement) { + VToolSinglePoint::ReadToolAttributes(domElement); + firstCurveId = doc->GetParametrUInt(domElement, AttrCurve1, NULL_ID_STR); secondCurveId = doc->GetParametrUInt(domElement, AttrCurve2, NULL_ID_STR); vCrossPoint = static_cast(doc->GetParametrUInt(domElement, AttrVCrossPoint, QChar('1'))); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 143d97d42..2fec444b5 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -76,8 +76,9 @@ QT_WARNING_POP * @param id object id in container. * @param parent parent object. */ -VToolSinglePoint::VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent) - : VAbstractPoint(doc, data, id), +VToolSinglePoint::VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, + QGraphicsItem *parent) + : VAbstractPoint(doc, data, id, notes), VScenePoint(parent) { connect(m_namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolSinglePoint::contextMenuEvent); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h index 6487f3e87..8a14e8cb0 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h @@ -44,10 +44,10 @@ template class QSharedPointer; -struct VToolSinglePointInitData : VAbstractToolInitData +struct VToolSinglePointInitData : VDrawToolInitData { VToolSinglePointInitData() - : VAbstractToolInitData(), + : VDrawToolInitData(), name(), mx(5), my(10), @@ -67,7 +67,8 @@ class VToolSinglePoint: public VAbstractPoint, public VScenePoint { Q_OBJECT public: - VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr); + VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, + QGraphicsItem * parent = nullptr); virtual ~VToolSinglePoint() Q_DECL_EQ_DEFAULT; virtual int type() const override {return Type;} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index d71ee141c..12d8073fc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -64,7 +64,7 @@ const QString VToolTriangle::ToolType = QStringLiteral("triangle"); * @param parent parent object. */ VToolTriangle::VToolTriangle(const VToolTriangleInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, parent), + :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), axisP1Id(initData.axisP1Id), axisP2Id(initData.axisP2Id), firstPointId(initData.firstPointId), @@ -88,6 +88,7 @@ void VToolTriangle::setDialog() dialogTool->SetFirstPointId(firstPointId); dialogTool->SetSecondPointId(secondPointId); dialogTool->SetPointName(p->name()); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -117,6 +118,7 @@ VToolTriangle* VToolTriangle::Create(const QPointer &dialog, VMainGr initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolTriangle* point = Create(initData); if (point != nullptr) @@ -302,6 +304,9 @@ void VToolTriangle::SaveDialog(QDomElement &domElement, QList &oldDepen doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->GetAxisP2Id())); doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -319,6 +324,8 @@ void VToolTriangle::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolTriangle::ReadToolAttributes(const QDomElement &domElement) { + VToolSinglePoint::ReadToolAttributes(domElement); + axisP1Id = doc->GetParametrUInt(domElement, AttrAxisP1, NULL_ID_STR); axisP2Id = doc->GetParametrUInt(domElement, AttrAxisP2, NULL_ID_STR); firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp index 6fa93514d..b65b5a6aa 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp @@ -36,8 +36,8 @@ #include "../vdrawtool.h" //--------------------------------------------------------------------------------------------------------------------- -VAbstractPoint::VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id) - :VDrawTool(doc, data, id) +VAbstractPoint::VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es) + :VDrawTool(doc, data, id, notes) {} //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h index dd106fd96..e78ac1799 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h @@ -53,7 +53,7 @@ class VAbstractPoint: public VDrawTool { Q_OBJECT public: - VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id); + VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es); virtual ~VAbstractPoint() Q_DECL_EQ_DEFAULT; virtual QString getTagName() const override; diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.cpp b/src/libs/vtools/tools/drawTools/vdrawtool.cpp index 1abee64b1..9da4faddb 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.cpp +++ b/src/libs/vtools/tools/drawTools/vdrawtool.cpp @@ -56,10 +56,11 @@ template class QSharedPointer; * @param data container with variables. * @param id object id in container. */ -VDrawTool::VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent) +VDrawTool::VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, QObject *parent) : VInteractiveTool(doc, data, id, parent), nameActivDraw(doc->GetNameActivPP()), - m_lineType(TypeLineLine) + m_lineType(TypeLineLine), + m_notes(notes) { connect(this->doc, &VAbstractPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw); connect(this->doc, &VAbstractPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw); @@ -175,6 +176,7 @@ void VDrawTool::SaveOptions(QDomElement &tag, QSharedPointer &obj) Q_UNUSED(obj) doc->SetAttribute(tag, VDomDocument::AttrId, m_id); + doc->SetAttributeOrRemoveIf(tag, AttrNotes, m_notes, m_notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -210,6 +212,12 @@ void VDrawTool::ReadAttributes() } } +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::ReadToolAttributes(const QDomElement &domElement) +{ + m_notes = doc->GetParametrEmptyString(domElement, AttrNotes); +} + //--------------------------------------------------------------------------------------------------------------------- void VDrawTool::EnableToolMove(bool move) { @@ -266,7 +274,7 @@ QString VDrawTool::getLineType() const } //--------------------------------------------------------------------------------------------------------------------- -void VDrawTool::SetTypeLine(const QString &value) +void VDrawTool::SetLineType(const QString &value) { m_lineType = value; @@ -280,3 +288,18 @@ bool VDrawTool::IsLabelVisible(quint32 id) const Q_UNUSED(id) return false; } + +//--------------------------------------------------------------------------------------------------------------------- +QString VDrawTool::GetNotes() const +{ + return m_notes; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::SetNotes(const QString ¬es) +{ + m_notes = notes; + + QSharedPointer obj = VAbstractTool::data.GetGObject(m_id); + SaveOption(obj); +} diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index b8de88334..95b32081a 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -53,6 +53,16 @@ #include "../vgeometry/vpointf.h" #include "../vtools/undocommands/undogroup.h" +struct VDrawToolInitData : VAbstractToolInitData +{ + VDrawToolInitData() + : VAbstractToolInitData(), + notes() + {} + + QString notes; +}; + /** * @brief The VDrawTool abstract class for all draw tool. */ @@ -61,14 +71,17 @@ class VDrawTool : public VInteractiveTool Q_OBJECT public: - VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); + VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, const QString ¬es, QObject *parent = nullptr); virtual ~VDrawTool() Q_DECL_EQ_DEFAULT; QString getLineType() const; - virtual void SetTypeLine(const QString &value); + virtual void SetLineType(const QString &value); virtual bool IsLabelVisible(quint32 id) const; + QString GetNotes() const; + void SetNotes(const QString ¬es); + signals: void ChangedToolSelection(bool selected, quint32 object, quint32 tool); @@ -92,6 +105,8 @@ protected: /** @brief typeLine line type. */ QString m_lineType; + QString m_notes{}; + void AddToCalculation(const QDomElement &domElement); void AddDependence(QList &list, quint32 objectId) const; @@ -109,7 +124,7 @@ protected: bool CorrectDisable(bool disable, const QString &namePP) const; void ReadAttributes(); - virtual void ReadToolAttributes(const QDomElement &domElement)=0; + virtual void ReadToolAttributes(const QDomElement &domElement); virtual void ChangeLabelVisibility(quint32 id, bool visible); template diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index b054c4edd..78aa29b2a 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -61,7 +61,7 @@ template class QSharedPointer; * @param parent parent object. */ VToolLine::VToolLine(const VToolLineInitData &initData, QGraphicsItem *parent) - :VDrawTool(initData.doc, initData.data, initData.id), + :VDrawTool(initData.doc, initData.data, initData.id, initData.notes), VScaledLine(parent), firstPoint(initData.firstPoint), secondPoint(initData.secondPoint), @@ -92,6 +92,7 @@ void VToolLine::setDialog() dialogTool->SetSecondPoint(secondPoint); dialogTool->SetTypeLine(m_lineType); dialogTool->SetLineColor(lineColor); + dialogTool->SetNotes(m_notes); } //--------------------------------------------------------------------------------------------------------------------- @@ -119,6 +120,7 @@ VToolLine *VToolLine::Create(const QPointer &dialog, VMainGraphicsSc initData.data = data; initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; + initData.notes = dialogTool->GetNotes(); VToolLine *line = Create(initData); if (line != nullptr) @@ -391,6 +393,9 @@ void VToolLine::SaveDialog(QDomElement &domElement, QList &oldDependenc doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + + const QString notes = dialogTool->GetNotes(); + doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -407,6 +412,8 @@ void VToolLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) //--------------------------------------------------------------------------------------------------------------------- void VToolLine::ReadToolAttributes(const QDomElement &domElement) { + VDrawTool::ReadToolAttributes(domElement); + firstPoint = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); secondPoint = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); @@ -473,7 +480,7 @@ void VToolLine::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -void VToolLine::SetTypeLine(const QString &value) +void VToolLine::SetLineType(const QString &value) { m_lineType = value; diff --git a/src/libs/vtools/tools/drawTools/vtoolline.h b/src/libs/vtools/tools/drawTools/vtoolline.h index 669b0243f..92b1540f4 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.h +++ b/src/libs/vtools/tools/drawTools/vtoolline.h @@ -44,10 +44,10 @@ template class QSharedPointer; -struct VToolLineInitData : VAbstractToolInitData +struct VToolLineInitData : VDrawToolInitData { VToolLineInitData() - : VAbstractToolInitData(), + : VDrawToolInitData(), firstPoint(NULL_ID), secondPoint(NULL_ID), typeLine(TypeLineLine), @@ -87,7 +87,7 @@ public: virtual void ShowVisualization(bool show) override; - virtual void SetTypeLine(const QString &value) override; + virtual void SetLineType(const QString &value) override; virtual void GroupVisibility(quint32 object, bool visible) override; public slots: virtual void FullUpdateFromFile() override;