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() ...@@ -207,17 +207,19 @@ void QmlGraphicsItemNodeInstance::refresh()
repositioning(qmlGraphicsItem()); repositioning(qmlGraphicsItem());
} }
void QmlGraphicsItemNodeInstance::recursiveDoComponentComplete(QGraphicsItem *item) void QmlGraphicsItemNodeInstance::recursiveDoComponentComplete(QDeclarativeItem *declarativeItem)
{ {
QGraphicsObject *graphicsObject = item->toGraphicsObject(); if (declarativeItem) {
QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(graphicsObject); if (QDeclarativeItemPrivate::get(declarativeItem)->componentComplete)
if (declarativeItem && !nodeInstanceServer()->hasInstanceForObject(declarativeItem)) {
if (QDeclarativeItemPrivate::get(qmlGraphicsItem())->componentComplete)
return; return;
static_cast<QDeclarativeParserStatus*>(qmlGraphicsItem())->componentComplete(); static_cast<QDeclarativeParserStatus*>(declarativeItem)->componentComplete();
foreach (QGraphicsItem *childItem, item->childItems()) foreach (QGraphicsItem *childItem, declarativeItem->childItems()) {
recursiveDoComponentComplete(childItem); QGraphicsObject *childGraphicsObject = childItem->toGraphicsObject();
QDeclarativeItem *childDeclarativeItem = qobject_cast<QDeclarativeItem*>(childGraphicsObject);
if (childDeclarativeItem && !nodeInstanceServer()->hasInstanceForObject(childDeclarativeItem))
recursiveDoComponentComplete(childDeclarativeItem);
}
} }
} }
......
...@@ -85,7 +85,7 @@ protected: ...@@ -85,7 +85,7 @@ protected:
void resetHorizontal(); void resetHorizontal();
void resetVertical(); void resetVertical();
void refresh(); void refresh();
void recursiveDoComponentComplete(QGraphicsItem *item); void recursiveDoComponentComplete(QDeclarativeItem *declarativeItem);
private: //variables private: //variables
bool m_hasHeight; 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