No point in casting a QSGItem to a QSGItem and checking whether it
really was one.
Change-Id: Iaa82e1cb62f801f456b9020c4d410c13bfd3a9ea
Reviewed-by: Gunnar Sletta
// 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;
}