diff options
author | Jarek Kobus <jaroslaw.kobus@theqtcompany.com> | 2016-02-16 11:01:26 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@theqtcompany.com> | 2016-02-18 11:00:23 +0000 |
commit | 6ebe444a7caf6cca81b3ec626936253f175eca28 (patch) | |
tree | 680c227c3c1b962b03b9fad9fb32fa3272d286cc /tools | |
parent | 6bfaed1525dabf82f2dfd429420163c5bef8e083 (diff) |
Add version info to qscxmlc
Change-Id: I9aa5d010c9e0245f3f5c9a604089e4556c76e9ea
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qscxmlc/qscxmlc.cpp | 4 | ||||
-rw-r--r-- | tools/qscxmlc/scxmlcppdumper.cpp | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/tools/qscxmlc/qscxmlc.cpp b/tools/qscxmlc/qscxmlc.cpp index 3b3ab7b..3d8d284 100644 --- a/tools/qscxmlc/qscxmlc.cpp +++ b/tools/qscxmlc/qscxmlc.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ #include <QtScxml/private/qscxmlparser_p.h> +#include <QtScxml/qscxmltabledata.h> #include "scxmlcppdumper.h" #include <QCoreApplication> @@ -81,6 +82,9 @@ static void collectAllDocuments(DocumentModel::ScxmlDocument *doc, QMap<Document int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); + a.setApplicationVersion(QString::fromLatin1("%1 (Qt %2)").arg( + QString::number(Q_QSCXMLC_OUTPUT_REVISION), + QString::fromLatin1(QT_VERSION_STR))); QStringList args = a.arguments(); QString usage = QStringLiteral("\nUsage: %1 [-no-c++11] [-namespace <namespace>] [-o <base/out/name>] [-oh <header/out>] [-ocpp <cpp/out>] [-use-private-api]\n").arg(QFileInfo(args.value(0)).baseName()); usage += QStringLiteral(" [-classname <stateMachineClassName>] <input.scxml>\n\n"); diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp index 257315d..fe6afe3 100644 --- a/tools/qscxmlc/scxmlcppdumper.cpp +++ b/tools/qscxmlc/scxmlcppdumper.cpp @@ -38,8 +38,6 @@ QT_BEGIN_NAMESPACE -enum { qscxmlcOutputRevision = 1 }; - static const QString doNotEditComment = QString::fromLatin1( "//\n" "// Statemachine code from reading SCXML file '%1'\n" @@ -50,7 +48,7 @@ static const QString doNotEditComment = QString::fromLatin1( static const QString revisionCheck = QString::fromLatin1( "#if !defined(Q_QSCXMLC_OUTPUT_REVISION)\n" - "#error \"The header file '%1' doesn't include <qscxmlqstates.h>.\"\n" + "#error \"The header file '%1' doesn't include <qscxmltabledata.h>.\"\n" "#elif Q_QSCXMLC_OUTPUT_REVISION != %2\n" "#error \"This file was generated using the qscxmlc from %3. It\"\n" "#error \"cannot be used with the include files from this version of Qt.\"\n" @@ -1295,7 +1293,7 @@ QString CppDumper::mangleId(const QString &id) // TODO: remove void CppDumper::writeHeaderStart(const QString &headerGuard, const QStringList &forwardDecls) { - h << doNotEditComment.arg(m_translationUnit->scxmlFileName, QString::number(qscxmlcOutputRevision), QString::fromLatin1(QT_VERSION_STR)) + h << doNotEditComment.arg(m_translationUnit->scxmlFileName, QString::number(Q_QSCXMLC_OUTPUT_REVISION), QString::fromLatin1(QT_VERSION_STR)) << endl; h << QStringLiteral("#ifndef ") << headerGuard << endl @@ -1380,7 +1378,7 @@ void CppDumper::writeHeaderEnd(const QString &headerGuard, const QStringList &me void CppDumper::writeImplStart(const QVector<ClassDump> &allClazzes) { - cpp << doNotEditComment.arg(m_translationUnit->scxmlFileName, QString::number(qscxmlcOutputRevision), QString::fromLatin1(QT_VERSION_STR)) + cpp << doNotEditComment.arg(m_translationUnit->scxmlFileName, QString::number(Q_QSCXMLC_OUTPUT_REVISION), QString::fromLatin1(QT_VERSION_STR)) << endl; StringListDumper includes; @@ -1399,7 +1397,7 @@ void CppDumper::writeImplStart(const QVector<ClassDump> &allClazzes) cpp << endl; } cpp << endl - << revisionCheck.arg(m_translationUnit->scxmlFileName, QString::number(qscxmlcOutputRevision), QString::fromLatin1(QT_VERSION_STR)) + << revisionCheck.arg(m_translationUnit->scxmlFileName, QString::number(Q_QSCXMLC_OUTPUT_REVISION), QString::fromLatin1(QT_VERSION_STR)) << endl; if (!m_translationUnit->namespaceName.isEmpty()) cpp << l("namespace ") << m_translationUnit->namespaceName << l(" {") << endl << endl; |