Commit 4cdfacff authored by Marco Bubke's avatar Marco Bubke

QmlDesigner.NodeInstances: Fix component complete

Task-number: QTCREATORBUG-5338

Change-Id: Iaaaf2cd5440fa8d2f7baae8c42b9234d231a45aa
Reviewed-on: http://codereview.qt.nokia.com/1322Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarMarco Bubke <marco.bubke@nokia.com>
parent 9ed30fd9
......@@ -207,17 +207,19 @@ void QmlGraphicsItemNodeInstance::refresh()
repositioning(qmlGraphicsItem());
}
void QmlGraphicsItemNodeInstance::recursiveDoComponentComplete(QGraphicsItem *item)
void QmlGraphicsItemNodeInstance::recursiveDoComponentComplete(QDeclarativeItem *declarativeItem)
{
QGraphicsObject *graphicsObject = item->toGraphicsObject();
QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(graphicsObject);
if (declarativeItem && !nodeInstanceServer()->hasInstanceForObject(declarativeItem)) {
if (QDeclarativeItemPrivate::get(qmlGraphicsItem())->componentComplete)
if (declarativeItem) {
if (QDeclarativeItemPrivate::get(declarativeItem)->componentComplete)
return;
static_cast<QDeclarativeParserStatus*>(qmlGraphicsItem())->componentComplete();
static_cast<QDeclarativeParserStatus*>(declarativeItem)->componentComplete();
foreach (QGraphicsItem *childItem, item->childItems())
recursiveDoComponentComplete(childItem);
foreach (QGraphicsItem *childItem, declarativeItem->childItems()) {
QGraphicsObject *childGraphicsObject = childItem->toGraphicsObject();
QDeclarativeItem *childDeclarativeItem = qobject_cast<QDeclarativeItem*>(childGraphicsObject);
if (childDeclarativeItem && !nodeInstanceServer()->hasInstanceForObject(childDeclarativeItem))
recursiveDoComponentComplete(childDeclarativeItem);
}
}
}
......
......@@ -85,7 +85,7 @@ protected:
void resetHorizontal();
void resetVertical();
void refresh();
void recursiveDoComponentComplete(QGraphicsItem *item);
void recursiveDoComponentComplete(QDeclarativeItem *declarativeItem);
private: //variables
bool m_hasHeight;
......
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