aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2011-06-10 17:54:29 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2011-06-23 16:34:45 +0200
commit09b01b54f23fb10fd6b63398edf813a2bbd04cff (patch)
tree0bc22aefd941ee821770b8c3d4140d02c8efbe26
parent4196ff229b3385e5097699c159e9226bd86a95a6 (diff)
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
-rw-r--r--src/declarative/items/qsgitem.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/declarative/items/qsgitem.cpp b/src/declarative/items/qsgitem.cpp
index 3b07503f35..aa8fec7061 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<QSGItem *> children = childItems();
for (int i = children.count()-1; i >= 0; --i) {
- if (QSGItem *child = qobject_cast<QSGItem *>(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;
}