FEM: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-14 19:45:24 +02:00
committed by wwmayer
parent 26ea9e4ea4
commit 89b9a7ae0f
37 changed files with 460 additions and 534 deletions

View File

@@ -511,12 +511,11 @@ void ViewProviderFemConstraint::updateRotation(const SoNode *node, const int idx
QObject *ViewProviderFemConstraint::findChildByName(const QObject *parent, const QString &name)
{
for (QObjectList::const_iterator o = parent->children().begin(); o != parent->children().end();
o++) {
if ((*o)->objectName() == name)
return *o;
if (!(*o)->children().empty()) {
QObject *result = findChildByName(*o, name);
for (auto o : parent->children()) {
if (o->objectName() == name)
return o;
if (!o->children().empty()) {
QObject *result = findChildByName(o, name);
if (result)
return result;
}