forked from qt-creator/qt-creator
Valgrind: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464 Change-Id: Ia507fb7aab405226a954b6059ef326e999a8171a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -236,7 +236,8 @@ void Visualization::Private::handleMousePressEvent(QMouseEvent *event,
|
||||
{
|
||||
// find the first item that accepts mouse presses under the cursor position
|
||||
QGraphicsItem *itemAtPos = nullptr;
|
||||
foreach (QGraphicsItem *item, q->items(event->pos())) {
|
||||
const QList<QGraphicsItem *>items = q->items(event->pos());
|
||||
for (QGraphicsItem *item : items) {
|
||||
if (!(item->acceptedMouseButtons() & event->button()))
|
||||
continue;
|
||||
|
||||
@@ -291,7 +292,8 @@ const Function *Visualization::functionForItem(QGraphicsItem *item) const
|
||||
|
||||
QGraphicsItem *Visualization::itemForFunction(const Function *function) const
|
||||
{
|
||||
foreach (QGraphicsItem *item, items()) {
|
||||
const QList<QGraphicsItem *> itemList = items();
|
||||
for (QGraphicsItem *item : itemList) {
|
||||
if (functionForItem(item) == function)
|
||||
return item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user