diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlcachegen/generateloader.cpp | 3 | ||||
-rw-r--r-- | tools/qmlplugindump/main.cpp | 7 | ||||
-rw-r--r-- | tools/qmlpreview/qmlpreviewapplication.cpp | 26 | ||||
-rw-r--r-- | tools/qmlpreview/qmlpreviewapplication.h | 4 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 60 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.h | 4 | ||||
-rw-r--r-- | tools/qmlscene/main.cpp | 4 | ||||
-rw-r--r-- | tools/tools.pro | 8 |
8 files changed, 58 insertions, 58 deletions
diff --git a/tools/qmlcachegen/generateloader.cpp b/tools/qmlcachegen/generateloader.cpp index 68aacf78ce..de79576d67 100644 --- a/tools/qmlcachegen/generateloader.cpp +++ b/tools/qmlcachegen/generateloader.cpp @@ -26,6 +26,7 @@ ** ****************************************************************************/ #include <QByteArray> +#include <QRegExp> #include <QString> #include <QStringList> #include <QTextStream> @@ -344,7 +345,7 @@ bool generateLoader(const QStringList &compiledFiles, const QString &outputFileN for (int i = 0; i < compiledFiles.count(); ++i) { const QString compiledFile = compiledFiles.at(i); const QString ns = symbolNamespaceForPath(compiledFile); - stream << "namespace " << symbolNamespaceForPath(compiledFile) << " { \n"; + stream << "namespace " << ns << " { \n"; stream << " extern const unsigned char qmlData[];\n"; stream << " const QQmlPrivate::CachedQmlUnit unit = {\n"; stream << " reinterpret_cast<const QV4::CompiledData::Unit*>(&qmlData), nullptr, nullptr\n"; diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index f5bd6d2291..565152d5d2 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -76,9 +76,9 @@ namespace { const uint qtQmlMajorVersion = 2; -const uint qtQmlMinorVersion = QT_VERSION_MINOR; +const uint qtQmlMinorVersion = 0; const uint qtQuickMajorVersion = 2; -const uint qtQuickMinorVersion = QT_VERSION_MINOR; +const uint qtQuickMinorVersion = 0; const QString qtQuickQualifiedName = QString::fromLatin1("QtQuick %1.%2") .arg(qtQuickMajorVersion) @@ -1138,8 +1138,7 @@ int main(int argc, char *argv[]) QRegularExpressionMatchIterator i = re.globalMatch(merge[1]); while (i.hasNext()) { QRegularExpressionMatch m = i.next(); - QString d = m.captured(1); - mergeDependencies << m.captured(1); + mergeDependencies << m.captured(1); } mergeComponents = merge [2]; } diff --git a/tools/qmlpreview/qmlpreviewapplication.cpp b/tools/qmlpreview/qmlpreviewapplication.cpp index 02f10831ec..57453e0cb9 100644 --- a/tools/qmlpreview/qmlpreviewapplication.cpp +++ b/tools/qmlpreview/qmlpreviewapplication.cpp @@ -104,11 +104,11 @@ void QmlPreviewApplication::parseArguments() parser.addHelpOption(); parser.addVersionOption(); - parser.addPositionalArgument(QLatin1String("program"), - tr("The program to be started and previewed."), - QLatin1String("[program]")); + parser.addPositionalArgument(QLatin1String("executable"), + tr("The executable to be started and previewed."), + QLatin1String("[executable]")); parser.addPositionalArgument(QLatin1String("parameters"), - tr("Parameters for the program to be started."), + tr("Parameters for the executable to be started."), QLatin1String("[parameters...]")); parser.process(*this); @@ -120,12 +120,12 @@ void QmlPreviewApplication::parseArguments() if (parser.isSet(verbose)) m_verbose = true; - m_programArguments = parser.positionalArguments(); - if (!m_programArguments.isEmpty()) - m_programPath = m_programArguments.takeFirst(); + m_arguments = parser.positionalArguments(); + if (!m_arguments.isEmpty()) + m_executablePath = m_arguments.takeFirst(); - if (m_programPath.isEmpty()) { - logError(tr("You have to specify a program to start.")); + if (m_executablePath.isEmpty()) { + logError(tr("You have to specify an executable to start.")); parser.showHelp(2); } } @@ -143,17 +143,17 @@ void QmlPreviewApplication::run() m_process.reset(new QProcess(this)); QStringList arguments; arguments << QString("-qmljsdebugger=file:%1,block,services:QmlPreview").arg(m_socketFile); - arguments << m_programArguments; + arguments << m_arguments; m_process->setProcessChannelMode(QProcess::MergedChannels); connect(m_process.data(), &QIODevice::readyRead, this, &QmlPreviewApplication::processHasOutput); connect(m_process.data(), static_cast<void(QProcess::*)(int)>(&QProcess::finished), this, [this](int){ processFinished(); }); - logStatus(QString("Starting '%1 %2' ...").arg(m_programPath, arguments.join(QLatin1Char(' ')))); - m_process->start(m_programPath, arguments); + logStatus(QString("Starting '%1 %2' ...").arg(m_executablePath, arguments.join(QLatin1Char(' ')))); + m_process->start(m_executablePath, arguments); if (!m_process->waitForStarted()) { - logError(QString("Could not run '%1': %2").arg(m_programPath, m_process->errorString())); + logError(QString("Could not run '%1': %2").arg(m_executablePath, m_process->errorString())); exit(1); } m_connectTimer.start(); diff --git a/tools/qmlpreview/qmlpreviewapplication.h b/tools/qmlpreview/qmlpreviewapplication.h index 7da4a9ab5c..51a70cbac3 100644 --- a/tools/qmlpreview/qmlpreviewapplication.h +++ b/tools/qmlpreview/qmlpreviewapplication.h @@ -63,8 +63,8 @@ private: bool sendFile(const QString &path); void sendDirectory(const QString &path); - QString m_programPath; - QStringList m_programArguments; + QString m_executablePath; + QStringList m_arguments; QScopedPointer<QProcess> m_process; bool m_verbose; diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index 6732766b46..a1e4d9a153 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -29,7 +29,6 @@ #include "qmlprofilerapplication.h" #include "constants.h" #include <QtCore/QStringList> -#include <QtCore/QTextStream> #include <QtCore/QProcess> #include <QtCore/QTimer> #include <QtCore/QDateTime> @@ -38,6 +37,8 @@ #include <QtCore/QCommandLineParser> #include <QtCore/QTemporaryFile> +#include <iostream> + static const char commandTextC[] = "The following commands are available:\n" "'r', 'record'\n" @@ -52,8 +53,8 @@ static const char commandTextC[] = " Stop recording if it is running, then output the\n" " data, and finally clear it from memory.\n" "'q', 'quit'\n" - " Terminate the program if started from qmlprofiler,\n" - " and qmlprofiler itself."; + " Terminate the target process if started from\n" + " qmlprofiler, and qmlprofiler itself."; static const char *features[] = { "javascript", @@ -120,10 +121,8 @@ QmlProfilerApplication::~QmlProfilerApplication() logStatus("Killing process ..."); m_process->kill(); } - if (isInteractive()) { - QTextStream err(stderr); - err << endl; - } + if (isInteractive()) + std::cerr << std::endl; delete m_process; } @@ -199,11 +198,11 @@ void QmlProfilerApplication::parseArguments() parser.addHelpOption(); parser.addVersionOption(); - parser.addPositionalArgument(QLatin1String("program"), - tr("The program to be started and profiled."), - QLatin1String("[program]")); + parser.addPositionalArgument(QLatin1String("executable"), + tr("The executable to be started and profiled."), + QLatin1String("[executable]")); parser.addPositionalArgument(QLatin1String("parameters"), - tr("Parameters for the program to be started."), + tr("Parameters for the executable to be started."), QLatin1String("[parameters...]")); parser.process(*this); @@ -252,17 +251,17 @@ void QmlProfilerApplication::parseArguments() if (parser.isSet(verbose)) m_verbose = true; - m_programArguments = parser.positionalArguments(); - if (!m_programArguments.isEmpty()) - m_programPath = m_programArguments.takeFirst(); + m_arguments = parser.positionalArguments(); + if (!m_arguments.isEmpty()) + m_executablePath = m_arguments.takeFirst(); - if (m_runMode == LaunchMode && m_programPath.isEmpty()) { - logError(tr("You have to specify either --attach or a program to start.")); + if (m_runMode == LaunchMode && m_executablePath.isEmpty()) { + logError(tr("You have to specify either --attach or an executable to start.")); parser.showHelp(2); } - if (m_runMode == AttachMode && !m_programPath.isEmpty()) { - logError(tr("--attach cannot be used when starting a program.")); + if (m_runMode == AttachMode && !m_executablePath.isEmpty()) { + logError(tr("--attach cannot be used when starting an executable.")); parser.showHelp(3); } } @@ -469,17 +468,17 @@ void QmlProfilerApplication::run() arguments << QString::fromLatin1("-qmljsdebugger=%1:%2,block,services:CanvasFrameRate") .arg(QLatin1String(m_socketFile.isEmpty() ? "port" : "file")) .arg(m_socketFile.isEmpty() ? QString::number(m_port) : m_socketFile); - arguments << m_programArguments; + arguments << m_arguments; m_process->setProcessChannelMode(QProcess::MergedChannels); connect(m_process, &QIODevice::readyRead, this, &QmlProfilerApplication::processHasOutput); connect(m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished), this, [this](int){ processFinished(); }); - logStatus(QString("Starting '%1 %2' ...").arg(m_programPath, + logStatus(QString("Starting '%1 %2' ...").arg(m_executablePath, arguments.join(QLatin1Char(' ')))); - m_process->start(m_programPath, arguments); + m_process->start(m_executablePath, arguments); if (!m_process->waitForStarted()) { - logError(QString("Could not run '%1': %2").arg(m_programPath, + logError(QString("Could not run '%1': %2").arg(m_executablePath, m_process->errorString())); exit(1); } @@ -539,10 +538,8 @@ void QmlProfilerApplication::disconnected() void QmlProfilerApplication::processHasOutput() { Q_ASSERT(m_process); - while (m_process->bytesAvailable()) { - QTextStream out(stderr); - out << m_process->readAll(); - } + while (m_process->bytesAvailable()) + std::cerr << m_process->readAll().constData(); } void QmlProfilerApplication::processFinished() @@ -594,10 +591,9 @@ void QmlProfilerApplication::traceFinished() void QmlProfilerApplication::prompt(const QString &line, bool ready) { if (m_interactive) { - QTextStream err(stderr); if (!line.isEmpty()) - err << line << endl; - err << QLatin1String("> "); + std::cerr << qPrintable(line) << std::endl; + std::cerr << "> "; if (ready) emit readyForCommand(); } @@ -605,14 +601,12 @@ void QmlProfilerApplication::prompt(const QString &line, bool ready) void QmlProfilerApplication::logError(const QString &error) { - QTextStream err(stderr); - err << "Error: " << error << endl; + std::cerr << "Error: " << qPrintable(error) << std::endl; } void QmlProfilerApplication::logStatus(const QString &status) { if (!m_verbose) return; - QTextStream err(stderr); - err << status << endl; + std::cerr << qPrintable(status) << std::endl; } diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h index 2d00e2b7c5..73b2b231cd 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.h +++ b/tools/qmlprofiler/qmlprofilerapplication.h @@ -91,8 +91,8 @@ private: } m_runMode; // LaunchMode - QString m_programPath; - QStringList m_programArguments; + QString m_executablePath; + QStringList m_arguments; QProcess *m_process; QString m_socketFile; diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index c1399c38e5..465bcb53d4 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -53,8 +53,8 @@ #include <QtWidgets/QApplication> #if QT_CONFIG(filedialog) #include <QtWidgets/QFileDialog> -#endif -#endif +#endif // QT_CONFIG(filedialog) +#endif // QT_WIDGETS_LIB #include <QtCore/QTranslator> #include <QtCore/QLibraryInfo> diff --git a/tools/tools.pro b/tools/tools.pro index d3ec380717..2e2eb831a9 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -28,7 +28,13 @@ qtConfig(thread):!android|android_app { qmlplugindump } } - qtHaveModule(widgets): SUBDIRS += qmleasing + qtHaveModule(widgets) { + QT_FOR_CONFIG += widgets + qtConfig(dialogbuttonbox) { + SUBDIRS += \ + qmleasing + } + } } qtHaveModule(qmltest): SUBDIRS += qmltestrunner qtConfig(private_tests): SUBDIRS += qmljs |