summaryrefslogtreecommitdiff
path: root/src/plugins/scxmleditor
diff options
context:
space:
mode:
authorMarco Benelli <marco.benelli@qt.io>2017-08-10 14:05:59 +0200
committerMarco Benelli <marco.benelli@qt.io>2017-09-04 15:30:27 +0000
commit77f6a4321eba9c9d74d93e4668bc5edc3583d35f (patch)
treea063f066b33f1e5648247e7a7e392bf553891242 /src/plugins/scxmleditor
parent33bb20ba5766465d5683577e6f816298cbcfaf34 (diff)
downloadqt-creator-77f6a4321eba9c9d74d93e4668bc5edc3583d35f.tar.gz
SCXML editor: allow eventless transitions
According to SCXML specification (https://www.w3.org/TR/scxml/), the 'event' attribute is not mandatory in 'transition' tags. Also, as specified in section 3.12.1, eventless transitions are handled differently, and will be taken whenever the 'cond' attribute evaluates to 'true'. This patch removes the automatic assignment of 'event' property in the tag constructors, but restore it when a new transition is done in the editor. In this way, the user can delete the unneeded events without them being restored when reloading the document. Task-number: QTCREATORBUG-18345 Change-Id: I96d6860ad3ed58ab49e83d3328e88ef984f40fa4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/scxmleditor')
-rw-r--r--src/plugins/scxmleditor/plugin_interface/connectableitem.cpp1
-rw-r--r--src/plugins/scxmleditor/plugin_interface/scxmltag.cpp3
2 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/scxmleditor/plugin_interface/connectableitem.cpp b/src/plugins/scxmleditor/plugin_interface/connectableitem.cpp
index 853d9d1b25..82200f2a57 100644
--- a/src/plugins/scxmleditor/plugin_interface/connectableitem.cpp
+++ b/src/plugins/scxmleditor/plugin_interface/connectableitem.cpp
@@ -230,6 +230,7 @@ bool ConnectableItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
else
newTag = new ScxmlTag(Transition, tag()->document());
newTag->setAttribute("type", "external");
+ newTag->setAttribute("event", tag()->document()->nextUniqueId("Transition"));
m_newTransition->init(newTag);
tag()->document()->addTag(tag(), newTag);
diff --git a/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp b/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp
index 0548972ad0..f44ca314b6 100644
--- a/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp
+++ b/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp
@@ -168,9 +168,6 @@ void ScxmlTag::initId()
case History:
setAttribute("id", m_document->nextUniqueId("History"));
break;
- case Transition:
- setAttribute("event", m_document->nextUniqueId("Transition"));
- break;
case Final:
setAttribute("id", m_document->nextUniqueId("Final"));
break;