@@ -471,7 +471,7 @@ void layoutItems(FrameGraphicsItem* parent)
471471 < static_cast <const FrameGraphicsItem*>(rhs)->symbol ();
472472 });
473473
474- foreach (auto child, children) {
474+ for (auto child : children) {
475475 auto frameChild = static_cast <FrameGraphicsItem*>(child);
476476 const qreal w = maxWidth * double (frameChild->cost ()) / parent->cost ();
477477 frameChild->setVisible (w > 1 );
@@ -485,7 +485,7 @@ void layoutItems(FrameGraphicsItem* parent)
485485
486486FrameGraphicsItem* findItemBySymbol (const QList<QGraphicsItem*>& items, const Data::Symbol& symbol)
487487{
488- foreach (auto item_, items) {
488+ for (auto item_ : items) {
489489 auto item = static_cast <FrameGraphicsItem*>(item_);
490490 if (item->symbol () == symbol) {
491491 return item;
@@ -501,7 +501,7 @@ template<typename Tree>
501501void toGraphicsItems (const Data::Costs& costs, int type, const QVector<Tree>& data, FrameGraphicsItem* parent,
502502 const double costThreshold, const BrushConfig& brushConfig, bool collapseRecursion)
503503{
504- foreach (const auto & row, data) {
504+ for (const auto & row : data) {
505505 if (collapseRecursion && !row.symbol .symbol .isEmpty () && row.symbol == parent->symbol ()) {
506506 if (costs.cost (type, row.id ) > costThreshold) {
507507 toGraphicsItems (costs, type, row.children , parent, costThreshold, brushConfig, collapseRecursion);
@@ -1178,7 +1178,8 @@ void FlameGraph::selectItem(FrameGraphicsItem* item)
11781178 rect.setWidth (rootWidth);
11791179 parent->setRect (rect);
11801180 if (parent->parentItem ()) {
1181- foreach (auto sibling, parent->parentItem ()->childItems ()) {
1181+ const auto children = parent->parentItem ()->childItems ();
1182+ for (auto sibling : children) {
11821183 sibling->setVisible (sibling == parent);
11831184 }
11841185 }
0 commit comments