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);
|
||||
else if (type == FlowTransition)
|
||||
formEditorItem = new FormEditorTransitionItem(qmlItemNode, this);
|
||||
else if (type == FlowDecision)
|
||||
formEditorItem = new FormEditorFlowDecisionItem(qmlItemNode, this);
|
||||
else if (type == FlowWildcard)
|
||||
formEditorItem = new FormEditorFlowWildcardItem(qmlItemNode, this);
|
||||
else
|
||||
formEditorItem = new FormEditorItem(qmlItemNode, this);
|
||||
|
||||
|
@@ -55,7 +55,9 @@ public:
|
||||
Default,
|
||||
Flow,
|
||||
FlowAction,
|
||||
FlowTransition
|
||||
FlowTransition,
|
||||
FlowDecision,
|
||||
FlowWildcard
|
||||
};
|
||||
|
||||
FormEditorScene(FormEditorWidget *widget, FormEditorView *editorView);
|
||||
|
@@ -105,6 +105,16 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
|
||||
if (qmlItemNode.hasNodeParent())
|
||||
m_scene->reparentItem(qmlItemNode, qmlItemNode.modelParentItem());
|
||||
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()) {
|
||||
m_scene->addFormEditorItem(qmlItemNode.toQmlItemNode(), FormEditorScene::FlowAction);
|
||||
m_scene->synchronizeParent(qmlItemNode.toQmlItemNode());
|
||||
@@ -134,6 +144,10 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
|
||||
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
|
||||
if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowTransition()) {
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user