Mesh: replace slots with member function pointers

This commit is contained in:
wmayer
2023-02-01 16:23:38 +01:00
committed by Uwe
parent a0548860d2
commit ab71c4b8a4
2 changed files with 11 additions and 11 deletions

View File

@@ -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);
}
}
}

View File

@@ -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<CurveOnMeshHandler*>(ud);
QTimer::singleShot(100, self, SLOT(onContextMenu()));
QTimer::singleShot(100, self, &CurveOnMeshHandler::onContextMenu);
}
}
}