From 09b01b54f23fb10fd6b63398edf813a2bbd04cff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Fri, 10 Jun 2011 17:54:29 +0200 Subject: [PATCH] Removed unnecessary qobject_cast in QSGItem::childAt No point in casting a QSGItem to a QSGItem and checking whether it really was one. Change-Id: Iaa82e1cb62f801f456b9020c4d410c13bfd3a9ea Reviewed-by: Gunnar Sletta --- src/declarative/items/qsgitem.cpp | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/declarative/items/qsgitem.cpp b/src/declarative/items/qsgitem.cpp index 3b07503..aa8fec7 100644 --- a/src/declarative/items/qsgitem.cpp +++ b/src/declarative/items/qsgitem.cpp @@ -1879,13 +1879,12 @@ QSGItem *QSGItem::childAt(qreal x, qreal y) const // XXX todo - should this include transform etc.? const QList children = childItems(); for (int i = children.count()-1; i >= 0; --i) { - if (QSGItem *child = qobject_cast(children.at(i))) { - if (child->isVisible() && child->x() <= x + QSGItem *child = children.at(i); + if (child->isVisible() && child->x() <= x && child->x() + child->width() >= x && child->y() <= y && child->y() + child->height() >= y) - return child; - } + return child; } return 0; } -- 1.7.2.5