Commit 9b45d0e2 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: treat window as item



For simplicity we just pretend Window is an item.
The state editing is broken atm but does not crash.
We will fix this later.

Change-Id: I5da0c624b467448cccf16a88fa3ad3682f4ccc20
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 1a1791ab
......@@ -42,10 +42,24 @@
namespace QmlDesigner {
namespace {
bool isItemOrWindow(const ModelNode &modelNode)
{
if (modelNode.metaInfo().isSubclassOf("QtQuick.Item", -1, -1))
return true;
if (modelNode.metaInfo().isSubclassOf("QtQuick.Window.Window", -1, -1) && modelNode.isRootNode())
return true;
return false;
}
}
bool QmlItemNode::isValid() const
{
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().isSubclassOf("QtQuick.Item", -1, -1);
return QmlModelNodeFacade::isValid() && modelNode().metaInfo().isValid() && isItemOrWindow(modelNode());
}
bool QmlItemNode::isRootNode() const
......
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