summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-30 08:45:34 +0100
committerLiang Qi <liang.qi@qt.io>2017-10-30 09:24:34 +0100
commit2143fd3362cc294c3076f879ef20c70ed3683f33 (patch)
tree132ea199c80976b10be4e086dcb8ef34bfb4cad6
parent3ba4176568867cb146c2b758cd39461367ad22d1 (diff)
parent113b502b194d6d7573b9f86f400bdf481e98cf74 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta4
Conflicts: .qmake.conf Change-Id: Idcb35d4015f20d785263f00fe42d4839c7c4ad48
-rw-r--r--dist/changes-5.9.222
-rw-r--r--examples/scxml/calculator-qml/calculator-qml.qml13
-rw-r--r--examples/scxml/mediaplayer-common/Mediaplayer.qml18
-rw-r--r--src/imports/scxmlstatemachine/statemachineloader.cpp13
4 files changed, 52 insertions, 14 deletions
diff --git a/dist/changes-5.9.2 b/dist/changes-5.9.2
new file mode 100644
index 0000000..a4cffb5
--- /dev/null
+++ b/dist/changes-5.9.2
@@ -0,0 +1,22 @@
+Qt 5.9.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.9.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.9 series is binary compatible with the 5.8.x series.
+Applications compiled for 5.8 will continue to run with 5.9.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.9.2 Changes *
+****************************************************************************
diff --git a/examples/scxml/calculator-qml/calculator-qml.qml b/examples/scxml/calculator-qml/calculator-qml.qml
index 386549e..c7d8236 100644
--- a/examples/scxml/calculator-qml/calculator-qml.qml
+++ b/examples/scxml/calculator-qml/calculator-qml.qml
@@ -79,8 +79,8 @@ Window {
color: "#46a2da"
Text {
id: resultText
- anchors.leftMargin: operations.implicitMargin
- anchors.rightMargin: operations.implicitMargin
+ anchors.leftMargin: buttons.implicitMargin
+ anchors.rightMargin: buttons.implicitMargin
anchors.fill: parent
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
@@ -93,7 +93,7 @@ Window {
}
Item {
- id: operations
+ id: buttons
anchors.top: resultArea.bottom
anchors.left: parent.left
anchors.right: parent.right
@@ -102,12 +102,13 @@ Window {
var ret = 0;
for (var i = 0; i < visibleChildren.length; ++i) {
var child = visibleChildren[i];
- ret += (child.implicitMargin || 0) / visibleChildren.length;
+ ret += (child.implicitMargin || 0);
}
- return ret;
+ return ret / visibleChildren.length;
}
Repeater {
+ id: operations
model: ["÷", "×", "+", "-"]
Button {
y: 0
@@ -130,6 +131,7 @@ Window {
}
Repeater {
+ id: digits
model: ["7", "8", "9", "4", "5", "6", "1", "2", "3", "0", ".", "C"]
Button {
x: (index % 3) * width
@@ -150,6 +152,7 @@ Window {
}
Button {
+ id: resultButton
x: 3 * width
y: parent.height / 5
textHeight: y - 2
diff --git a/examples/scxml/mediaplayer-common/Mediaplayer.qml b/examples/scxml/mediaplayer-common/Mediaplayer.qml
index fdeb9d2..42a948a 100644
--- a/examples/scxml/mediaplayer-common/Mediaplayer.qml
+++ b/examples/scxml/mediaplayer-common/Mediaplayer.qml
@@ -119,22 +119,24 @@ Window {
stateMachine: root.stateMachine
events: ["playbackStarted", "playbackStopped"]
onOccurred: {
- var media = event.data.media
+ var media = event.data.media;
if (event.name === "playbackStarted") {
- theText.text = "Playing '" + media + "'"
+ theText.text = "Playing '" + media + "'";
theLog.text = theLog.text + "\nplaybackStarted with data: "
- + JSON.stringify(event.data)
+ + JSON.stringify(event.data);
} else if (event.name === "playbackStopped") {
- theText.text = "Stopped '" + media + "'"
+ theText.text = "Stopped '" + media + "'";
theLog.text = theLog.text + "\nplaybackStopped with data: "
- + JSON.stringify(event.data)
+ + JSON.stringify(event.data);
}
}
}
+ // Submit tap event to state machine.
+ // "tap" toggles playing state of the current media.
function tap(idx) {
- var media = theModel.get(idx).media
- var data = { "media": media }
- stateMachine.submitEvent("tap", data)
+ var media = theModel.get(idx).media;
+ var data = { "media": media };
+ stateMachine.submitEvent("tap", data);
}
}
diff --git a/src/imports/scxmlstatemachine/statemachineloader.cpp b/src/imports/scxmlstatemachine/statemachineloader.cpp
index 946988f..0d28e6c 100644
--- a/src/imports/scxmlstatemachine/statemachineloader.cpp
+++ b/src/imports/scxmlstatemachine/statemachineloader.cpp
@@ -163,7 +163,18 @@ bool QScxmlStateMachineLoader::parse(const QUrl &source)
return false;
}
- m_stateMachine = QScxmlStateMachine::fromData(&buf, source.toString());
+ QString fileName;
+ if (source.isLocalFile()) {
+ fileName = source.toLocalFile();
+ } else if (source.scheme() == QStringLiteral("qrc")) {
+ fileName = ":" + source.path();
+ } else {
+ qmlWarning(this) << QStringLiteral("%1 is neither a local nor a resource URL.")
+ .arg(source.url())
+ << QStringLiteral("Invoking services by relative path will not work.");
+ }
+
+ m_stateMachine = QScxmlStateMachine::fromData(&buf, fileName);
m_stateMachine->setParent(this);
m_implicitDataModel = m_stateMachine->dataModel();