Part: modernize C++: use range-based for loop
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user