QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList);
if (firstSelectableItem == 0)
return false;
-
- QDeclarativeItem *declarativeItem
- = dynamic_cast<QDeclarativeItem*>(firstSelectableItem->toGraphicsObject());
-
- if (declarativeItem != 0)
+ if (toQDeclarativeItem(firstSelectableItem) != 0)
return true;
return false;
QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item)
{
- return dynamic_cast<QDeclarativeItem*>(item->toGraphicsObject());
+ return qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
}
QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList)
void QDeclarativeViewObserverPrivate::_q_removeFromSelection(QObject *obj)
{
QList<QGraphicsItem*> items = selectedItems();
- if (QGraphicsItem *item = dynamic_cast<QGraphicsItem*>(obj))
+ if (QGraphicsItem *item = qobject_cast<QGraphicsObject*>(obj))
items.removeOne(item);
setSelectedItems(items);
}