Refactoring MainWindowsNoGUI::PrepareDetailsForLayout. Use const iterator.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-06-26 14:33:34 +03:00
parent 39c84aa2c2
commit 93836ddf35

View File

@ -464,18 +464,18 @@ void MainWindowsNoGUI::PrepareDetailsForLayout(const QHash<quint32, VDetail> *de
} }
listDetails.clear(); listDetails.clear();
QHashIterator<quint32, VDetail> idetail(*details); QHash<quint32, VDetail>::const_iterator i = details->constBegin();
while (idetail.hasNext()) while (i != details->constEnd())
{ {
idetail.next();
VLayoutDetail det = VLayoutDetail(); VLayoutDetail det = VLayoutDetail();
const VDetail &d = idetail.value(); const VDetail d = i.value();
det.SetCountourPoints(d.ContourPoints(pattern)); det.SetCountourPoints(d.ContourPoints(pattern));
det.SetSeamAllowencePoints(d.SeamAllowancePoints(pattern), d.getSeamAllowance(), d.getClosed()); det.SetSeamAllowencePoints(d.SeamAllowancePoints(pattern), d.getSeamAllowance(), d.getClosed());
det.setName(d.getName()); det.setName(d.getName());
det.setWidth(qApp->toPixel(d.getWidth())); det.setWidth(qApp->toPixel(d.getWidth()));
listDetails.append(det); listDetails.append(det);
++i;
} }
} }