forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user