From 38f88ebfebeccc1a6c2b41f885b2a6a8fa74a447 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 10 Jul 2019 18:48:34 +0200 Subject: Bump Qt version to Qt 6 Also fix usages of text stream operators. Change-Id: I53cf87bb4bb055d56f2332d7737f205ec9560774 Reviewed-by: Qt CI Bot Reviewed-by: Simon Hausmann --- tools/qscxmlc/qscxmlc.cpp | 12 +++++------ tools/qscxmlc/scxmlcppdumper.cpp | 46 ++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 29 deletions(-) (limited to 'tools/qscxmlc') diff --git a/tools/qscxmlc/qscxmlc.cpp b/tools/qscxmlc/qscxmlc.cpp index ce45ed0..d83e786 100644 --- a/tools/qscxmlc/qscxmlc.cpp +++ b/tools/qscxmlc/qscxmlc.cpp @@ -57,13 +57,13 @@ int write(TranslationUnit *tu) QFile outH(tu->outHFileName); if (!outH.open(QFile::WriteOnly)) { - errs << QStringLiteral("Error: cannot open '%1': %2").arg(outH.fileName(), outH.errorString()) << endl; + errs << QStringLiteral("Error: cannot open '%1': %2").arg(outH.fileName(), outH.errorString()) << Qt::endl; return CannotOpenOutputHeaderFileError; } QFile outCpp(tu->outCppFileName); if (!outCpp.open(QFile::WriteOnly)) { - errs << QStringLiteral("Error: cannot open '%1': %2").arg(outCpp.fileName(), outCpp.errorString()) << endl; + errs << QStringLiteral("Error: cannot open '%1': %2").arg(outCpp.fileName(), outCpp.errorString()) << Qt::endl; return CannotOpenOutputCppFileError; } @@ -139,13 +139,13 @@ int run(const QStringList &arguments) const QStringList inputFiles = cmdParser.positionalArguments(); if (inputFiles.count() < 1) { - errs << QCoreApplication::translate("main", "Error: no input file.") << endl; + errs << QCoreApplication::translate("main", "Error: no input file.") << Qt::endl; cmdParser.showHelp(NoInputFilesError); } if (inputFiles.count() > 1) { errs << QCoreApplication::translate("main", "Error: unexpected argument(s): %1") - .arg(inputFiles.mid(1).join(QLatin1Char(' '))) << endl; + .arg(inputFiles.mid(1).join(QLatin1Char(' '))) << Qt::endl; cmdParser.showHelp(NoInputFilesError); } @@ -180,7 +180,7 @@ int run(const QStringList &arguments) if (!compiler.errors().isEmpty()) { const auto errors = compiler.errors(); for (const QScxmlError &error : errors) { - errs << error.toString() << endl; + errs << error.toString() << Qt::endl; } return ParseError; } @@ -190,7 +190,7 @@ int run(const QStringList &arguments) Q_ASSERT(!compiler.errors().isEmpty()); const auto errors = compiler.errors(); for (const QScxmlError &error : errors) { - errs << error.toString() << endl; + errs << error.toString() << Qt::endl; } return ScxmlVerificationError; } diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp index 89a403b..6f81bd9 100644 --- a/tools/qscxmlc/scxmlcppdumper.cpp +++ b/tools/qscxmlc/scxmlcppdumper.cpp @@ -482,19 +482,19 @@ void CppDumper::writeHeaderStart(const QString &headerGuard, const QStringList & h << doNotEditComment.arg(m_translationUnit->scxmlFileName, QString::number(Q_QSCXMLC_OUTPUT_REVISION), QString::fromLatin1(QT_VERSION_STR)) - << endl; + << Qt::endl; - h << QStringLiteral("#ifndef ") << headerGuard << endl - << QStringLiteral("#define ") << headerGuard << endl - << endl; + h << QStringLiteral("#ifndef ") << headerGuard << Qt::endl + << QStringLiteral("#define ") << headerGuard << Qt::endl + << Qt::endl; h << l(headerStart); if (!m_translationUnit->namespaceName.isEmpty()) - h << l("namespace ") << m_translationUnit->namespaceName << l(" {") << endl << endl; + h << l("namespace ") << m_translationUnit->namespaceName << l(" {") << Qt::endl << Qt::endl; if (!forwardDecls.isEmpty()) { for (const QString &forwardDecl : forwardDecls) - h << QStringLiteral("class %1;").arg(forwardDecl) << endl; - h << endl; + h << QStringLiteral("class %1;").arg(forwardDecl) << Qt::endl; + h << Qt::endl; } } @@ -517,17 +517,17 @@ void CppDumper::writeHeaderEnd(const QString &headerGuard, const QStringList &me { QString ns; if (!m_translationUnit->namespaceName.isEmpty()) { - h << QStringLiteral("} // %1 namespace ").arg(m_translationUnit->namespaceName) << endl - << endl; + h << QStringLiteral("} // %1 namespace ").arg(m_translationUnit->namespaceName) << Qt::endl + << Qt::endl; ns = QStringLiteral("::%1").arg(m_translationUnit->namespaceName); } for (const QString &name : metatypeDecls) { - h << QStringLiteral("Q_DECLARE_METATYPE(%1::%2*)").arg(ns, name) << endl; + h << QStringLiteral("Q_DECLARE_METATYPE(%1::%2*)").arg(ns, name) << Qt::endl; } - h << endl; + h << Qt::endl; - h << QStringLiteral("#endif // ") << headerGuard << endl; + h << QStringLiteral("#endif // ") << headerGuard << Qt::endl; } void CppDumper::writeImplStart() @@ -535,7 +535,7 @@ void CppDumper::writeImplStart() cpp << doNotEditComment.arg(m_translationUnit->scxmlFileName, QString::number(Q_QSCXMLC_OUTPUT_REVISION), l(QT_VERSION_STR)) - << endl; + << Qt::endl; QStringList includes; for (DocumentModel::ScxmlDocument *doc : qAsConst(m_translationUnit->allDocuments)) { @@ -556,20 +556,20 @@ void CppDumper::writeImplStart() includes.removeDuplicates(); QString headerName = QFileInfo(m_translationUnit->outHFileName).fileName(); - cpp << l("#include \"") << headerName << l("\"") << endl; - cpp << endl - << QStringLiteral("#include ") << endl - << QStringLiteral("#include ") << endl; + cpp << l("#include \"") << headerName << l("\"") << Qt::endl; + cpp << Qt::endl + << QStringLiteral("#include ") << Qt::endl + << QStringLiteral("#include ") << Qt::endl; for (const QString &inc : qAsConst(includes)) { - cpp << l("#include <") << inc << l(">") << endl; + cpp << l("#include <") << inc << l(">") << Qt::endl; } - cpp << endl + cpp << Qt::endl << revisionCheck.arg(m_translationUnit->scxmlFileName, QString::number(Q_QSCXMLC_OUTPUT_REVISION), QString::fromLatin1(QT_VERSION_STR)) - << endl; + << Qt::endl; if (!m_translationUnit->namespaceName.isEmpty()) - cpp << l("namespace ") << m_translationUnit->namespaceName << l(" {") << endl << endl; + cpp << l("namespace ") << m_translationUnit->namespaceName << l(" {") << Qt::endl << Qt::endl; } void CppDumper::writeImplBody(const GeneratedTableData &table, @@ -629,8 +629,8 @@ void CppDumper::writeImplBody(const GeneratedTableData &table, void CppDumper::writeImplEnd() { if (!m_translationUnit->namespaceName.isEmpty()) { - cpp << endl - << QStringLiteral("} // %1 namespace").arg(m_translationUnit->namespaceName) << endl; + cpp << Qt::endl + << QStringLiteral("} // %1 namespace").arg(m_translationUnit->namespaceName) << Qt::endl; } } -- cgit v1.2.3