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

This commit is contained in:
wmayer
2023-08-15 17:28:50 +02:00
committed by Chris Hennes
parent 9a1f8a11d6
commit 312975edba
49 changed files with 364 additions and 365 deletions

View File

@@ -100,8 +100,8 @@ void LoftWidget::findShapes()
std::vector<App::DocumentObject*> objs = activeDoc->getObjectsOfType<App::DocumentObject>();
for (std::vector<App::DocumentObject*>::iterator it = objs.begin(); it!=objs.end(); ++it) {
Part::TopoShape topoShape = Part::Feature::getTopoShape(*it);
for (auto obj : objs) {
Part::TopoShape topoShape = Part::Feature::getTopoShape(obj);
if (topoShape.isNull()) {
continue;
}
@@ -143,13 +143,13 @@ void LoftWidget::findShapes()
shape.ShapeType() == TopAbs_WIRE ||
shape.ShapeType() == TopAbs_EDGE ||
shape.ShapeType() == TopAbs_VERTEX) {
QString label = QString::fromUtf8((*it)->Label.getValue());
QString name = QString::fromLatin1((*it)->getNameInDocument());
QString label = QString::fromUtf8(obj->Label.getValue());
QString name = QString::fromLatin1(obj->getNameInDocument());
QTreeWidgetItem* child = new QTreeWidgetItem();
child->setText(0, label);
child->setToolTip(0, label);
child->setData(0, Qt::UserRole, name);
Gui::ViewProvider* vp = activeGui->getViewProvider(*it);
Gui::ViewProvider* vp = activeGui->getViewProvider(obj);
if (vp) child->setIcon(0, vp->getIcon());
d->ui.selector->availableTreeWidget()->addTopLevelItem(child);
}