diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index 17f984845..ff55d7efb 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -75,7 +75,7 @@ void VToolOptionsPropertyBrowser::ClearPropertyBrowser() void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item) { // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used in switch."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45, "Not all tools was used in switch."); switch (item->type()) { @@ -199,7 +199,7 @@ void VToolOptionsPropertyBrowser::UpdateOptions() } // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used in switch."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45, "Not all tools was used in switch."); switch (currentItem->type()) { @@ -334,7 +334,7 @@ void VToolOptionsPropertyBrowser::userChangedData(VProperty *property) } // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used in switch."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45, "Not all tools was used in switch."); switch (currentItem->type()) { diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index a70a3aaab..45dff4255 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -208,7 +208,7 @@ void DialogHistory::FillTable() QString DialogHistory::Record(const VToolRecord &tool) { // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used in history."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45, "Not all tools was used in history."); const QDomElement domElem = doc->elementById(tool.getId()); if (domElem.isElement() == false) @@ -227,6 +227,7 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::AbstractSpline: case Tool::Cut: case Tool::Midpoint:// Same as Tool::AlongLine, but tool will never has such type + case Tool::ArcIntersectAxis:// Same as Tool::CurveIntersectAxis, but tool will never has such type case Tool::LAST_ONE_DO_NOT_USE: Q_UNREACHABLE(); //-V501 break; diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index fc7d16472..4da6d58e2 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -1096,7 +1096,7 @@ void MainWindow::ToolArcIntersectAxis(bool checked) { ToolSelectAllDrawObjects(); // Reuse ToolCurveIntersectAxis but with different cursor and tool tip - SetToolButtonWithApply(checked, Tool::CurveIntersectAxis, + SetToolButtonWithApply(checked, Tool::ArcIntersectAxis, ":/cursor/arc_intersect_axis_cursor.png", tr("Select arc"), &MainWindow::ClosedDialogWithApply, @@ -1806,7 +1806,7 @@ void MainWindow::mouseMove(const QPointF &scenePos) void MainWindow::CancelTool() { // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was handled."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45, "Not all tools was handled."); qCDebug(vMainWindow, "Canceling tool."); delete dialogTool; @@ -1917,6 +1917,8 @@ void MainWindow::CancelTool() break; case Tool::CurveIntersectAxis: ui->toolButtonCurveIntersectAxis->setChecked(false); + break; + case Tool::ArcIntersectAxis: ui->toolButtonArcIntersectAxis->setChecked(false); break; case Tool::PointOfIntersectionArcs: @@ -3432,7 +3434,7 @@ void MainWindow::CreateMenus() void MainWindow::LastUsedTool() { // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was handled."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45, "Not all tools was handled."); if (currentTool == lastUsedTool) { @@ -3559,6 +3561,10 @@ void MainWindow::LastUsedTool() ui->toolButtonCurveIntersectAxis->setChecked(true); ToolCurveIntersectAxis(true); break; + case Tool::ArcIntersectAxis: + ui->toolButtonArcIntersectAxis->setChecked(true); + ToolArcIntersectAxis(true); + break; case Tool::PointOfIntersectionCircles: ui->toolButtonPointOfIntersectionCircles->setChecked(true); ToolPointOfIntersectionCircles(true); diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 324bf97c7..339d2f53c 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -3206,7 +3206,7 @@ void VPattern::ToolsCommonAttributes(const QDomElement &domElement, quint32 &id) QRectF VPattern::ActiveDrawBoundingRect() const { // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45, "Not all tools was used."); QRectF rec; @@ -3224,6 +3224,7 @@ QRectF VPattern::ActiveDrawBoundingRect() const case Tool::AbstractSpline: case Tool::Cut: case Tool::Midpoint:// Same as Tool::AlongLine, but tool will never has such type + case Tool::ArcIntersectAxis:// Same as Tool::CurveIntersectAxis, but tool will never has such type case Tool::LAST_ONE_DO_NOT_USE: Q_UNREACHABLE(); break; diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 2facbd16f..18ae28707 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1235,7 +1235,7 @@ QStringList VAbstractPattern::ListPointExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45); QStringList expressions; const QDomNodeList list = elementsByTagName(TagPoint); @@ -1306,7 +1306,7 @@ QStringList VAbstractPattern::ListArcExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45); QStringList expressions; const QDomNodeList list = elementsByTagName(TagArc); @@ -1367,7 +1367,7 @@ QStringList VAbstractPattern::ListPathPointExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45); QStringList expressions; const QDomNodeList list = elementsByTagName(AttrPathPoint); @@ -1433,7 +1433,7 @@ QStringList VAbstractPattern::ListOperationExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 44); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 45); QStringList expressions; const QDomNodeList list = elementsByTagName(TagOperation); diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index df6f28300..60399132f 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -96,6 +96,7 @@ enum class Tool : ToolVisHolderType PointOfIntersectionCircles, PointOfIntersectionCurves, CurveIntersectAxis, + ArcIntersectAxis, PointOfIntersection, PointFromCircleAndTangent, PointFromArcAndTangent,