Commit 62bdf344 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner.NodeInstances: Fix no content bug for webview

Now we test for all sub items too.

Task-number: QTCREATORBUG-3691
parent d9a43339
......@@ -72,6 +72,19 @@ QmlGraphicsItemNodeInstance::~QmlGraphicsItemNodeInstance()
{
}
bool anyItemHasContent(QGraphicsItem *graphicsItem)
{
if (!graphicsItem->flags().testFlag(QGraphicsItem::ItemHasNoContents))
return true;
foreach (QGraphicsItem *childItem, graphicsItem->childItems()) {
if (anyItemHasContent(childItem))
return true;
}
return false;
}
QmlGraphicsItemNodeInstance::Pointer QmlGraphicsItemNodeInstance::create(QObject *object)
{
QDeclarativeItem *qmlGraphicsItem = dynamic_cast<QDeclarativeItem*>(object);
......@@ -81,7 +94,7 @@ QmlGraphicsItemNodeInstance::Pointer QmlGraphicsItemNodeInstance::create(QObject
Pointer instance(new QmlGraphicsItemNodeInstance(qmlGraphicsItem));
instance->setHasContent(!qmlGraphicsItem->flags().testFlag(QGraphicsItem::ItemHasNoContents));
instance->setHasContent(anyItemHasContent(qmlGraphicsItem));
qmlGraphicsItem->setFlag(QGraphicsItem::ItemHasNoContents, false);
if (qmlGraphicsItem->inherits("QDeclarativeText"))
......
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