From ab71c4b8a4ec64c3f300b9c2992fc17181496901 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 1 Feb 2023 16:23:38 +0100 Subject: [PATCH] Mesh: replace slots with member function pointers --- src/Mod/Mesh/Gui/MeshEditor.cpp | 12 ++++++------ src/Mod/MeshPart/Gui/CurveOnMesh.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Mod/Mesh/Gui/MeshEditor.cpp b/src/Mod/Mesh/Gui/MeshEditor.cpp index 4db0fdc963..4d71ab2b1a 100644 --- a/src/Mod/Mesh/Gui/MeshEditor.cpp +++ b/src/Mod/Mesh/Gui/MeshEditor.cpp @@ -380,13 +380,13 @@ void MeshFaceAddition::addFacetCallback(void * ud, SoEventCallback * n) QAction* clr = menu.addAction(MeshFaceAddition::tr("Clear")); QAction* act = menu.exec(QCursor::pos()); if (act == add) { - QTimer::singleShot(300, that, SLOT(addFace())); + QTimer::singleShot(300, that, &MeshFaceAddition::addFace); } else if (act == swp) { - QTimer::singleShot(300, that, SLOT(flipNormal())); + QTimer::singleShot(300, that, &MeshFaceAddition::flipNormal); } else if (act == clr) { - QTimer::singleShot(300, that, SLOT(clearPoints())); + QTimer::singleShot(300, that, &MeshFaceAddition::clearPoints); } } } @@ -395,7 +395,7 @@ void MeshFaceAddition::addFacetCallback(void * ud, SoEventCallback * n) QAction* fin = menu.addAction(MeshFaceAddition::tr("Finish")); QAction* act = menu.exec(QCursor::pos()); if (act == fin) { - QTimer::singleShot(300, that, SLOT(finishEditing())); + QTimer::singleShot(300, that, &MeshFaceAddition::finishEditing); } } } @@ -717,7 +717,7 @@ void MeshFillHole::fileHoleCallback(void * ud, SoEventCallback * n) self->myNumPoints = 2; self->myVertex2 = vertex_index; self->myPolygon = it->second; - QTimer::singleShot(300, self, SLOT(closeBridge())); + QTimer::singleShot(300, self, &MeshFillHole::closeBridge); } } } @@ -728,7 +728,7 @@ void MeshFillHole::fileHoleCallback(void * ud, SoEventCallback * n) QAction* fin = menu.addAction(MeshFillHole::tr("Finish")); QAction* act = menu.exec(QCursor::pos()); if (act == fin) { - QTimer::singleShot(300, self, SLOT(finishEditing())); + QTimer::singleShot(300, self, &MeshFillHole::finishEditing); } } } diff --git a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp index 13c38b843e..ae1f13f2fb 100644 --- a/src/Mod/MeshPart/Gui/CurveOnMesh.cpp +++ b/src/Mod/MeshPart/Gui/CurveOnMesh.cpp @@ -361,12 +361,12 @@ void CurveOnMeshHandler::setParameters(int maxDegree, GeomAbs_Shape cont, double void CurveOnMeshHandler::onContextMenu() { QMenu menu; - menu.addAction(tr("Create"), this, SLOT(onCreate())); + menu.addAction(tr("Create"), this, &CurveOnMeshHandler::onCreate); if (!d_ptr->wireClosed && d_ptr->pickedPoints.size() >= 3) { - menu.addAction(tr("Close wire"), this, SLOT(onCloseWire())); + menu.addAction(tr("Close wire"), this, &CurveOnMeshHandler::onCloseWire); } - menu.addAction(tr("Clear"), this, SLOT(onClear())); - menu.addAction(tr("Cancel"), this, SLOT(onCancel())); + menu.addAction(tr("Clear"), this, &CurveOnMeshHandler::onClear); + menu.addAction(tr("Cancel"), this, &CurveOnMeshHandler::onCancel); menu.exec(QCursor::pos()); } @@ -657,7 +657,7 @@ void CurveOnMeshHandler::Private::vertexCallback(void * ud, SoEventCallback * cb } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON2 && mbe->getState() == SoButtonEvent::UP) { CurveOnMeshHandler* self = static_cast(ud); - QTimer::singleShot(100, self, SLOT(onContextMenu())); + QTimer::singleShot(100, self, &CurveOnMeshHandler::onContextMenu); } } }