From 63ec7e2ff9f5f63ff32c1fb874fd7de8b5bfdb02 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 19 Aug 2016 13:25:49 +0200 Subject: TrafficLight example: Use relative image file names in .qml examples It is not just better practice to reduce the absolute source file names to a minimum, but in this case it also enables the Qt Quick Designer to properly display the scene. Change-Id: I0be935584687c5f5099619ffe9c0e356d0b4d56b Reviewed-by: Erik Verbruggen Reviewed-by: Thomas Hartmann --- examples/scxml/trafficlight-common/TrafficLight.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/scxml/trafficlight-common/TrafficLight.qml b/examples/scxml/trafficlight-common/TrafficLight.qml index 03eac30..a23fca7 100644 --- a/examples/scxml/trafficlight-common/TrafficLight.qml +++ b/examples/scxml/trafficlight-common/TrafficLight.qml @@ -62,7 +62,7 @@ Window { Image { id: lights - source: "qrc:///background.png" + source: "background.png" MouseArea { anchors.fill: parent @@ -75,7 +75,7 @@ Window { id: redLight x: (lights.width - width) / 2 y: 40 - source: "qrc:///red.png" + source: "red.png" visible: stateMachine.red || stateMachine.redGoingGreen } @@ -83,7 +83,7 @@ Window { id: yellowLight x: (lights.width - width) / 2 y: 135 - source: "qrc:///yellow.png" + source: "yellow.png" visible: stateMachine.yellow || stateMachine.blinking } @@ -91,7 +91,7 @@ Window { id: greenLight x: (lights.width - width) / 2 y: 230 - source: "qrc:///green.png" + source: "green.png" visible: stateMachine.green } } @@ -102,7 +102,7 @@ Window { anchors.bottom: parent.bottom anchors.margins: 20 - source: stateMachine.working ? "qrc:///pause.png" : "qrc:///play.png" + source: stateMachine.working ? "pause.png" : "play.png" onClicked: { if (stateMachine.working) -- cgit v1.2.3 From 265107c6df0d89b138ab1a1e77de705223b01b8b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 18 Oct 2016 16:25:37 +0200 Subject: Fix qscxmlc documentation - Options use two hyphens rather than one. - The -oh and -ocpp options have been renamed. Change-Id: I4c41263ded3348a8bc43bb2a5813fb3b0d3bd90f Reviewed-by: Ulf Hermann Reviewed-by: Leena Miettinen --- tools/qscxmlc/doc/qscxmlc.qdoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/qscxmlc/doc/qscxmlc.qdoc b/tools/qscxmlc/doc/qscxmlc.qdoc index f0d6726..619390a 100644 --- a/tools/qscxmlc/doc/qscxmlc.qdoc +++ b/tools/qscxmlc/doc/qscxmlc.qdoc @@ -65,23 +65,23 @@ \li Option \li Description \row - \li \c -no-c++11 + \li \c --no-c++11 \li Use no C++11 features in the generated code. \row - \li \c {-namespace } + \li \c {--namespace } \li Put the generated class(es) in the specified namespace. \row \li \c {-o } \li The base name of the output files. This can include a path. If none is specified, the basename of the input file is used. \row - \li \c {-oh
} + \li \c {--header
} \li The name of the output header file. If none is specified, .h is added to the base name. \row - \li \c {-ocpp } + \li \c {--impl } \li The name of the output header file. If none is specified, .cpp is added to the base name. \row - \li \c {-classname } + \li \c {--classname } \li The class name of the generated state machine. If none is specified, the value of the name attribute of the tag is taken. If that attribute is not specified either, the basename (excluding path) is taken from the input file name. -- cgit v1.2.3 From cef09e6345d245b47eb115d438f6e367503d57f6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 15 Nov 2016 11:53:19 +0100 Subject: Do not accidentally generate <:: C/C++ uses <: as a digraph (for an opening bracket), so templateName<::namespaceName::className> would generate errors. (adapted from d7398f7f482d7a318d75f183758ee9bb37980b1a) Change-Id: I421c4cf5adf4934ababaef7cb38ba0f94bda49bd Task-number: QTBUG-53719 Reviewed-by: Erik Verbruggen --- tools/qscxmlc/scxmlcppdumper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp index a48a6b6..46ee774 100644 --- a/tools/qscxmlc/scxmlcppdumper.cpp +++ b/tools/qscxmlc/scxmlcppdumper.cpp @@ -398,7 +398,7 @@ protected: QStringList lines; for (int i = 0, ei = node->invokes.size(); i != ei; ++i) { Invoke *invoke = node->invokes.at(i); - QString line = QStringLiteral("new QScxmlInvokeScxmlFactory<%1>(").arg(scxmlClassName(invoke->content.data())); + QString line = QStringLiteral("new QScxmlInvokeScxmlFactory< %1 >(").arg(scxmlClassName(invoke->content.data())); line += QStringLiteral("%1, ").arg(Builder::createContext(QStringLiteral("invoke"))); line += QStringLiteral("%1, ").arg(addString(invoke->id)); line += QStringLiteral("%1, ").arg(addString(node->id + QStringLiteral(".session-"))); @@ -646,7 +646,7 @@ private: result += QStringLiteral("{ ") + elements.join(QStringLiteral(", ")) + QStringLiteral(" }"); } } else { - result += QStringLiteral("%1<%2>()").arg(baseType, elementType); + result += QStringLiteral("%1< %2 >()").arg(baseType, elementType); if (!elements.isEmpty()) { result += QStringLiteral(" << ") + elements.join(QStringLiteral(" << ")); } @@ -723,7 +723,7 @@ private: dm << QStringLiteral("bool handle(QScxmlEvent *event, QScxmlStateMachine *stateMachine) Q_DECL_OVERRIDE {"); if (m_qtMode) { dm << QStringLiteral(" if (event->originType() != QStringLiteral(\"qt:signal\")) { return true; }") - << QStringLiteral(" %1 *m = static_cast<%1 *>(stateMachine);").arg(clazz.className); + << QStringLiteral(" %1 *m = static_cast< %1 * >(stateMachine);").arg(clazz.className); foreach (const QString &signalName, m_signalNames) { dm << QStringLiteral(" if (event->name() == %1) { emit m->%2(event->data()); return false; }") .arg(qba(signalName), mangleIdentifier(signalName)); @@ -1487,7 +1487,7 @@ void CppDumper::writeImplBody(const ClassDump &clazz) cpp << clazz.className << l("::") << clazz.className << l("(QObject *parent)") << endl << QStringLiteral(" : QScxmlStateMachine(parent)") << endl << QStringLiteral(" , data(new Data(*this))") << endl - << QStringLiteral("{ qRegisterMetaType<%1 *>(); data->init(); }").arg(clazz.className) << endl + << QStringLiteral("{ qRegisterMetaType< %1 * >(); data->init(); }").arg(clazz.className) << endl << endl; cpp << clazz.className << l("::~") << clazz.className << l("()") << endl << l("{ delete data; }") << endl -- cgit v1.2.3