diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qml/main.cpp | 4 | ||||
-rw-r--r-- | tools/qml/qml.pro | 9 | ||||
-rw-r--r-- | tools/qmlcachegen/qmlcachegen.cpp | 7 | ||||
-rw-r--r-- | tools/qmleasing/qmleasing.pro | 9 | ||||
-rw-r--r-- | tools/qmlimportscanner/main.cpp | 6 | ||||
-rw-r--r-- | tools/qmlimportscanner/qmlimportscanner.pro | 9 | ||||
-rw-r--r-- | tools/qmljs/qmljs.cpp | 4 | ||||
-rw-r--r-- | tools/qmljs/qmljs.pro | 9 | ||||
-rw-r--r-- | tools/qmllint/qmllint.pro | 9 | ||||
-rw-r--r-- | tools/qmlmin/main.cpp | 10 | ||||
-rw-r--r-- | tools/qmlmin/qmlmin.pro | 9 | ||||
-rw-r--r-- | tools/qmlplugindump/main.cpp | 43 | ||||
-rw-r--r-- | tools/qmlplugindump/qmlplugindump.pro | 10 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofiler.pro | 9 | ||||
-rw-r--r-- | tools/qmlscene/qmlscene.pro | 9 | ||||
-rw-r--r-- | tools/qmltestrunner/qmltestrunner.pro | 9 | ||||
-rw-r--r-- | tools/qmltime/qmltime.pro | 9 | ||||
-rw-r--r-- | tools/tools.pro | 11 |
18 files changed, 158 insertions, 27 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index e8a506264c..1699d3d81b 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -130,7 +130,7 @@ class LoaderApplication : public QGuiApplication public: LoaderApplication(int& argc, char **argv) : QGuiApplication(argc, argv) {} - bool event(QEvent *ev) + bool event(QEvent *ev) override { if (ev->type() == QEvent::FileOpen) { if (exitTimerId >= 0) { @@ -144,7 +144,7 @@ public: return true; } - void timerEvent(QTimerEvent *) { + void timerEvent(QTimerEvent *) override { noFilesGiven(); } }; diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index 5f05054d04..d0083c0e78 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -6,6 +6,15 @@ HEADERS += conf.h SOURCES += main.cpp RESOURCES += qml.qrc +QMAKE_TARGET_PRODUCT = qml +QMAKE_TARGET_DESCRIPTION = Utility that loads and displays QML documents + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + mac { OTHER_FILES += Info.plist QMAKE_INFO_PLIST = Info.plist diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index 4b902eda0f..977c5b6ff1 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -141,7 +141,8 @@ static bool compileQmlFile(const QString &inputFileName, QV4::EvalISelFactory *i // ### translation binding simplification - QScopedPointer<QV4::EvalInstructionSelection> isel(iselFactory->create(/*engine*/nullptr, /*executable allocator*/nullptr, &irDocument.jsModule, &irDocument.jsGenerator)); + QV4::ExecutableAllocator allocator; + QScopedPointer<QV4::EvalInstructionSelection> isel(iselFactory->create(/*engine*/nullptr, &allocator, &irDocument.jsModule, &irDocument.jsGenerator)); // Disable lookups in non-standalone (aka QML) mode isel->setUseFastLookups(false); irDocument.javaScriptCompilationUnit = isel->compile(/*generate unit*/false); @@ -275,7 +276,9 @@ int main(int argc, char **argv) parser.process(app); const QStringList sources = parser.positionalArguments(); - if (sources.count() > 1) { + if (sources.isEmpty()){ + parser.showHelp(); + } else if (sources.count() > 1) { fprintf(stderr, "%s\n", qPrintable(QStringLiteral("Too many input files specified: '") + sources.join(QStringLiteral("' '")) + QLatin1Char('\''))); return EXIT_FAILURE; } diff --git a/tools/qmleasing/qmleasing.pro b/tools/qmleasing/qmleasing.pro index e334faa77a..534bc9fe98 100644 --- a/tools/qmleasing/qmleasing.pro +++ b/tools/qmleasing/qmleasing.pro @@ -17,4 +17,13 @@ FORMS += \ pane.ui \ import.ui +QMAKE_TARGET_PRODUCT = qmleasing +QMAKE_TARGET_DESCRIPTION = QML easing curve editor + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_app) diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp index ec52491322..26a83395c8 100644 --- a/tools/qmlimportscanner/main.cpp +++ b/tools/qmlimportscanner/main.cpp @@ -291,7 +291,7 @@ struct ImportCollector : public QQmlJS::Directives { QVariantList imports; - virtual void importFile(const QString &jsfile, const QString &module, int line, int column) + void importFile(const QString &jsfile, const QString &module, int line, int column) override { QVariantMap entry; entry[typeLiteral()] = QStringLiteral("javascript"); @@ -303,7 +303,7 @@ struct ImportCollector : public QQmlJS::Directives Q_UNUSED(column); } - virtual void importModule(const QString &uri, const QString &version, const QString &module, int line, int column) + void importModule(const QString &uri, const QString &version, const QString &module, int line, int column) override { QVariantMap entry; if (uri.contains(QLatin1Char('/'))) { @@ -539,7 +539,7 @@ int main(int argc, char *argv[]) if (arg.startsWith(QLatin1Char('-')) && arg != QLatin1String("-")) break; ++i; - if (!QFile::exists(arg)) { + if (arg != QLatin1String("-") && !QFile::exists(arg)) { std::cerr << qPrintable(appName) << ": No such file or directory: \"" << qPrintable(arg) << "\"\n"; return 1; diff --git a/tools/qmlimportscanner/qmlimportscanner.pro b/tools/qmlimportscanner/qmlimportscanner.pro index c8e458c6ae..363424f948 100644 --- a/tools/qmlimportscanner/qmlimportscanner.pro +++ b/tools/qmlimportscanner/qmlimportscanner.pro @@ -5,4 +5,13 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII SOURCES += main.cpp +QMAKE_TARGET_PRODUCT = qmlimportscanner +QMAKE_TARGET_DESCRIPTION = Tool to scan projects for QML imports + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmljs/qmljs.cpp b/tools/qmljs/qmljs.cpp index 4d0f9d278f..081e0660d5 100644 --- a/tools/qmljs/qmljs.cpp +++ b/tools/qmljs/qmljs.cpp @@ -69,9 +69,7 @@ static void showException(QV4::ExecutionContext *ctx, const QV4::Value &exceptio if (!e) { std::cerr << "Uncaught exception: " << qPrintable(ex->toQString()) << std::endl; } else { - QV4::ScopedString m(scope, scope.engine->newString(QStringLiteral("message"))); - QV4::ScopedValue message(scope, e->get(m)); - std::cerr << "Uncaught exception: " << qPrintable(message->toQStringNoThrow()) << std::endl; + std::cerr << "Uncaught exception: " << qPrintable(e->toQStringNoThrow()) << std::endl; } for (const QV4::StackFrame &frame : trace) { diff --git a/tools/qmljs/qmljs.pro b/tools/qmljs/qmljs.pro index 43f0ccba71..9f82f48980 100644 --- a/tools/qmljs/qmljs.pro +++ b/tools/qmljs/qmljs.pro @@ -5,4 +5,13 @@ SOURCES = qmljs.cpp include($$PWD/../../src/3rdparty/masm/masm-defs.pri) +QMAKE_TARGET_PRODUCT = qmljs +QMAKE_TARGET_DESCRIPTION = QML Javascript tool + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmllint/qmllint.pro b/tools/qmllint/qmllint.pro index bc6e27cec2..27af880c8c 100644 --- a/tools/qmllint/qmllint.pro +++ b/tools/qmllint/qmllint.pro @@ -4,4 +4,13 @@ QT = core qmldevtools-private SOURCES += main.cpp +QMAKE_TARGET_PRODUCT = qmllint +QMAKE_TARGET_DESCRIPTION = QML syntax verifier + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmlmin/main.cpp b/tools/qmlmin/main.cpp index 6877ca7442..5641e6348e 100644 --- a/tools/qmlmin/main.cpp +++ b/tools/qmlmin/main.cpp @@ -83,12 +83,12 @@ public: // // Handle the .pragma/.import directives // - virtual void pragmaLibrary() + void pragmaLibrary() override { _directives += QLatin1String(".pragma library\n"); } - virtual void importFile(const QString &jsfile, const QString &module, int line, int column) + void importFile(const QString &jsfile, const QString &module, int line, int column) override { _directives += QLatin1String(".import"); _directives += QLatin1Char('"'); @@ -101,7 +101,7 @@ public: Q_UNUSED(column); } - virtual void importModule(const QString &uri, const QString &version, const QString &module, int line, int column) + void importModule(const QString &uri, const QString &version, const QString &module, int line, int column) override { _directives += QLatin1String(".import "); _directives += uri; @@ -201,7 +201,7 @@ public: protected: void append(const QString &s); - bool parse(int startToken); + bool parse(int startToken) override; void escape(const QChar &ch, QString *out); }; @@ -409,7 +409,7 @@ public: QStringList tokenStream() const; protected: - virtual bool parse(int startToken); + bool parse(int startToken) override; }; Tokenize::Tokenize() diff --git a/tools/qmlmin/qmlmin.pro b/tools/qmlmin/qmlmin.pro index 2cbf196863..f5248e1b69 100644 --- a/tools/qmlmin/qmlmin.pro +++ b/tools/qmlmin/qmlmin.pro @@ -2,4 +2,13 @@ option(host_build) QT = core qmldevtools-private SOURCES += main.cpp +QMAKE_TARGET_PRODUCT = qmlmin +QMAKE_TARGET_DESCRIPTION = QML/JS minifier + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 774be45aec..dd7ae36c5d 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -33,6 +33,10 @@ #include <QtQuick/private/qquickevents_p_p.h> #include <QtQuick/private/qquickpincharea_p.h> +#ifdef QT_WIDGETS_LIB +#include <QApplication> +#endif // QT_WIDGETS_LIB + #include <QtGui/QGuiApplication> #include <QtCore/QDir> #include <QtCore/QFileInfo> @@ -741,8 +745,8 @@ void sigSegvHandler(int) { void printUsage(const QString &appName) { std::cerr << qPrintable(QString( - "Usage: %1 [-v] [-noinstantiate] [-defaultplatform] [-[non]relocatable] [-dependencies <dependencies.json>] [-merge <file-to-merge.qmltypes>] [-output <output-file.qmltypes>] [-noforceqtquick] module.uri version [module/import/path]\n" - " %1 [-v] [-noinstantiate] -path path/to/qmldir/directory [version]\n" + "Usage: %1 [-v] [-qapp] [-noinstantiate] [-defaultplatform] [-[non]relocatable] [-dependencies <dependencies.json>] [-merge <file-to-merge.qmltypes>] [-output <output-file.qmltypes>] [-noforceqtquick] module.uri version [module/import/path]\n" + " %1 [-v] [-qapp] [-noinstantiate] -path path/to/qmldir/directory [version]\n" " %1 [-v] -builtins\n" "Example: %1 Qt.labs.folderlistmodel 2.0 /home/user/dev/qt-install/imports").arg( appName)) << std::endl; @@ -839,7 +843,8 @@ static bool getDependencies(const QQmlEngine &engine, const QString &pluginImpor QStringList commandArgs = QStringList() << QLatin1String("-qmlFiles") << QLatin1String("-"); - const auto importPathList = engine.importPathList(); + QStringList importPathList = engine.importPathList(); + importPathList.removeOne(QStringLiteral("qrc:/qt-project.org/imports")); for (const QString &path : importPathList) commandArgs << QLatin1String("-importPath") << path; @@ -865,7 +870,9 @@ static bool getDependencies(const QQmlEngine &engine, const QString &pluginImpor QByteArray depencenciesData = importScanner.readAllStandardOutput(); if (!readDependenciesData(QLatin1String("<outputOfQmlimportscanner>"), depencenciesData, dependencies, QStringList(pluginImportUri), forceQtQuickDependency)) { - std::cerr << "failed to proecess output of qmlimportscanner" << std::endl; + std::cerr << "failed to process output of qmlimportscanner" << std::endl; + if (importScanner.exitCode() != 0) + std::cerr << importScanner.readAllStandardError().toStdString(); return false; } @@ -989,10 +996,25 @@ int main(int argc, char *argv[]) else QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); - QGuiApplication app(argc, argv); + // Check which kind of application should be instantiated. + bool useQApplication = false; + for (int i = 0; i < argc; ++i) { + QString arg = QLatin1String(argv[1]); + if (arg == QLatin1String("--qapp") || arg == QLatin1String("-qapp")) + useQApplication = true; + } + +#ifdef QT_WIDGETS_LIB + QScopedPointer<QCoreApplication> app(useQApplication + ? new QApplication(argc, argv) + : new QGuiApplication(argc, argv)); +#else + QScopedPointer<QCoreApplication> app(new QGuiApplication(argc, argv)); +#endif // QT_WIDGETS_LIB + QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - const QStringList args = app.arguments(); - const QString appName = QFileInfo(app.applicationFilePath()).baseName(); + const QStringList args = app->arguments(); + const QString appName = QFileInfo(app->applicationFilePath()).baseName(); if (args.size() < 2) { printUsage(appName); return EXIT_INVALIDARGUMENTS; @@ -1062,6 +1084,9 @@ int main(int argc, char *argv[]) } else if (arg == QLatin1String("--defaultplatform") || arg == QLatin1String("-defaultplatform")) { continue; + } else if (arg == QLatin1String("--qapp") + || arg == QLatin1String("-qapp")) { + continue; } else { std::cerr << "Invalid argument: " << qPrintable(arg) << std::endl; return EXIT_INVALIDARGUMENTS; @@ -1328,8 +1353,8 @@ int main(int argc, char *argv[]) QTimer timer; timer.setSingleShot(true); timer.setInterval(0); - QObject::connect(&timer, SIGNAL(timeout()), &app, SLOT(quit())); + QObject::connect(&timer, SIGNAL(timeout()), app.data(), SLOT(quit())); timer.start(); - return app.exec(); + return app->exec(); } diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro index b38eea2554..2749ec943f 100644 --- a/tools/qmlplugindump/qmlplugindump.pro +++ b/tools/qmlplugindump/qmlplugindump.pro @@ -1,4 +1,5 @@ QT += qml qml-private quick-private core-private +qtHaveModule(widgets): QT += widgets CONFIG += no_import_scan @@ -21,4 +22,13 @@ macx { CONFIG -= app_bundle } +QMAKE_TARGET_PRODUCT = qmlplugindump +QMAKE_TARGET_DESCRIPTION = QML plugin dump tool + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmlprofiler/qmlprofiler.pro b/tools/qmlprofiler/qmlprofiler.pro index a65e25c657..b5bb1dcc46 100644 --- a/tools/qmlprofiler/qmlprofiler.pro +++ b/tools/qmlprofiler/qmlprofiler.pro @@ -14,4 +14,13 @@ HEADERS += \ qmlprofilerdata.h \ qmlprofilerclient.h +QMAKE_TARGET_PRODUCT = qmlprofiler +QMAKE_TARGET_DESCRIPTION = QML profiler + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmlscene/qmlscene.pro b/tools/qmlscene/qmlscene.pro index b1267612c5..ec73f1871a 100644 --- a/tools/qmlscene/qmlscene.pro +++ b/tools/qmlscene/qmlscene.pro @@ -7,4 +7,13 @@ SOURCES += main.cpp DEFINES += QML_RUNTIME_TESTING !contains(QT_CONFIG, no-qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING +QMAKE_TARGET_PRODUCT = qmlscene +QMAKE_TARGET_DESCRIPTION = Utility that loads and displays QML documents + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmltestrunner/qmltestrunner.pro b/tools/qmltestrunner/qmltestrunner.pro index 1bb913e718..505537480c 100644 --- a/tools/qmltestrunner/qmltestrunner.pro +++ b/tools/qmltestrunner/qmltestrunner.pro @@ -3,4 +3,13 @@ SOURCES += main.cpp QT += qml qmltest CONFIG += no_import_scan +QMAKE_TARGET_PRODUCT = qmltestrunner +QMAKE_TARGET_DESCRIPTION = QML test runner + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + load(qt_tool) diff --git a/tools/qmltime/qmltime.pro b/tools/qmltime/qmltime.pro index 551a43eec1..ec1bcb5a03 100644 --- a/tools/qmltime/qmltime.pro +++ b/tools/qmltime/qmltime.pro @@ -4,4 +4,13 @@ QT += qml quick QT += quick-private macx:CONFIG -= app_bundle +QMAKE_TARGET_PRODUCT = qmltime +QMAKE_TARGET_DESCRIPTION = Tool for benchmarking the instantiation of a QML component + +win32 { + VERSION = $${QT_VERSION}.0 +} else { + VERSION = $${QT_VERSION} +} + SOURCES += qmltime.cpp diff --git a/tools/tools.pro b/tools/tools.pro index f3988a909a..bf39a649df 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -2,7 +2,8 @@ TEMPLATE = subdirs QT_FOR_CONFIG += qml-private SUBDIRS += \ qmlmin \ - qmlimportscanner + qmlimportscanner \ + qmlcachegen !android|android_app { SUBDIRS += \ @@ -15,8 +16,12 @@ SUBDIRS += \ !static: { SUBDIRS += \ qmlscene \ - qmlplugindump \ qmltime + + qtConfig(regularexpression) { + SUBDIRS += \ + qmlplugindump + } } qtHaveModule(widgets): SUBDIRS += qmleasing } @@ -27,7 +32,7 @@ SUBDIRS += \ qml.depends = qmlimportscanner qmleasing.depends = qmlimportscanner -# qmlmin, qmlimportscanner & qmlbundle are build tools. +# qmlmin, qmlimportscanner & qmlcachegen are build tools. # qmlscene is needed by the autotests. # qmltestrunner may be useful for manual testing. # qmlplugindump cannot be a build tool, because it loads target plugins. |