Commit 29777da9 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Avoid use of dynamic_cast in qmljsdebugger library

Remove usages of 'dynamic_cast' in qmljsdebugger library. Otherwise
compilation will fail for a Qt compiled with -no-rtti.

Task-number: QTCREATORBUG-4043
Reviewed-by: Kai Koehne
parent 7c1e0853
......@@ -88,11 +88,7 @@ bool AbstractLiveEditTool::topItemIsMovable(const QList<QGraphicsItem*> & itemLi
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;
......@@ -122,7 +118,7 @@ bool AbstractLiveEditTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*
QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item)
{
return dynamic_cast<QDeclarativeItem*>(item->toGraphicsObject());
return qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
}
QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList)
......
......@@ -416,7 +416,7 @@ void QDeclarativeViewObserverPrivate::_q_clearComponentCache()
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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment