From 194a1878dfe2bbe58b1946f4f402e04fad1f53bd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 8 May 2018 11:33:53 +0300 Subject: [PATCH] Refactoring. Move getting list of scene items from the loop. --HG-- branch : develop --- src/libs/vwidgets/vmaingraphicsview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/vwidgets/vmaingraphicsview.cpp b/src/libs/vwidgets/vmaingraphicsview.cpp index 8d85345ba..69239cbbe 100644 --- a/src/libs/vwidgets/vmaingraphicsview.cpp +++ b/src/libs/vwidgets/vmaingraphicsview.cpp @@ -513,9 +513,11 @@ void VMainGraphicsView::mousePressEvent(QMouseEvent *event) emit itemClicked(nullptr); break; } + + const QList sceneItems = this->scene()->items(); for (auto item : list) { - if (this->scene()->items().contains(item)) + if (sceneItems.contains(item)) { if (item->type() > QGraphicsItem::UserType && item->type() <= VSimpleCurve::Type) {