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
This commit is contained in:
parent
4196ff229b
commit
09b01b54f2
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue