forked from qt-creator/qt-creator
QmlDesigner: Create decision and wildcard items in form editor
Change-Id: Ib33c6fc9bc22885281b7172fe52e5326b6744cf3 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -178,6 +178,10 @@ FormEditorItem *FormEditorScene::addFormEditorItem(const QmlItemNode &qmlItemNod
|
|||||||
formEditorItem = new FormEditorFlowActionItem(qmlItemNode, this);
|
formEditorItem = new FormEditorFlowActionItem(qmlItemNode, this);
|
||||||
else if (type == FlowTransition)
|
else if (type == FlowTransition)
|
||||||
formEditorItem = new FormEditorTransitionItem(qmlItemNode, this);
|
formEditorItem = new FormEditorTransitionItem(qmlItemNode, this);
|
||||||
|
else if (type == FlowDecision)
|
||||||
|
formEditorItem = new FormEditorFlowDecisionItem(qmlItemNode, this);
|
||||||
|
else if (type == FlowWildcard)
|
||||||
|
formEditorItem = new FormEditorFlowWildcardItem(qmlItemNode, this);
|
||||||
else
|
else
|
||||||
formEditorItem = new FormEditorItem(qmlItemNode, this);
|
formEditorItem = new FormEditorItem(qmlItemNode, this);
|
||||||
|
|
||||||
|
@@ -55,7 +55,9 @@ public:
|
|||||||
Default,
|
Default,
|
||||||
Flow,
|
Flow,
|
||||||
FlowAction,
|
FlowAction,
|
||||||
FlowTransition
|
FlowTransition,
|
||||||
|
FlowDecision,
|
||||||
|
FlowWildcard
|
||||||
};
|
};
|
||||||
|
|
||||||
FormEditorScene(FormEditorWidget *widget, FormEditorView *editorView);
|
FormEditorScene(FormEditorWidget *widget, FormEditorView *editorView);
|
||||||
|
@@ -105,6 +105,16 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
|
|||||||
if (qmlItemNode.hasNodeParent())
|
if (qmlItemNode.hasNodeParent())
|
||||||
m_scene->reparentItem(qmlItemNode, qmlItemNode.modelParentItem());
|
m_scene->reparentItem(qmlItemNode, qmlItemNode.modelParentItem());
|
||||||
m_scene->synchronizeTransformation(m_scene->itemForQmlItemNode(qmlItemNode));
|
m_scene->synchronizeTransformation(m_scene->itemForQmlItemNode(qmlItemNode));
|
||||||
|
} else if (qmlItemNode.isFlowDecision()) {
|
||||||
|
m_scene->addFormEditorItem(qmlItemNode, FormEditorScene::FlowDecision);
|
||||||
|
if (qmlItemNode.hasNodeParent())
|
||||||
|
m_scene->reparentItem(qmlItemNode, qmlItemNode.modelParentItem());
|
||||||
|
m_scene->synchronizeTransformation(m_scene->itemForQmlItemNode(qmlItemNode));
|
||||||
|
} else if (qmlItemNode.isFlowWildcard()) {
|
||||||
|
m_scene->addFormEditorItem(qmlItemNode, FormEditorScene::FlowWildcard);
|
||||||
|
if (qmlItemNode.hasNodeParent())
|
||||||
|
m_scene->reparentItem(qmlItemNode, qmlItemNode.modelParentItem());
|
||||||
|
m_scene->synchronizeTransformation(m_scene->itemForQmlItemNode(qmlItemNode));
|
||||||
} else if (qmlItemNode.isFlowActionArea()) {
|
} else if (qmlItemNode.isFlowActionArea()) {
|
||||||
m_scene->addFormEditorItem(qmlItemNode.toQmlItemNode(), FormEditorScene::FlowAction);
|
m_scene->addFormEditorItem(qmlItemNode.toQmlItemNode(), FormEditorScene::FlowAction);
|
||||||
m_scene->synchronizeParent(qmlItemNode.toQmlItemNode());
|
m_scene->synchronizeParent(qmlItemNode.toQmlItemNode());
|
||||||
@@ -134,6 +144,10 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
|
|||||||
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
|
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
|
||||||
if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowTransition()) {
|
if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowTransition()) {
|
||||||
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
||||||
|
} else if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowDecision()) {
|
||||||
|
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
||||||
|
} else if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowWildcard()) {
|
||||||
|
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user