diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-07 13:20:36 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-07 13:20:36 +0100 |
commit | 4ab7deb923237b0186a211b0326217c480e33848 (patch) | |
tree | e277fb616e58e02bb49e0dc62d1ff9a039e8bcdb /tools | |
parent | c3f03bbff1db14dc5b5436d8aef834512207d498 (diff) | |
parent | bb921064b966efdaabc2245cad21c3d852848a22 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Ica75a71062d0613e415f2433c5c22c2e251b37cd
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qml/main.cpp | 11 | ||||
-rw-r--r-- | tools/qmlplugindump/main.cpp | 40 | ||||
-rw-r--r-- | tools/qmlscene/main.cpp | 11 |
3 files changed, 47 insertions, 15 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 240ddde6f1..ff559e7076 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -332,9 +332,8 @@ void printUsage() printf("\t-desktop.......................Force use of desktop GL (AA_UseDesktopOpenGL)\n"); printf("\t-gles..........................Force use of GLES (AA_UseOpenGLES)\n"); printf("\t-software......................Force use of software rendering (AA_UseOpenGLES)\n"); -#if 0 // FIXME: 5.6: Re-enable once attribute naming is final (QTBUG-46615) - printf("\t-no-scaling....................Disable High DPI scaling (AA_NoHighDpiScaling)\n"); -#endif + printf("\t-scaling.......................Enable High DPI scaling (AA_EnableHighDpiScaling)\n"); + printf("\t-no-scaling....................Disable High DPI scaling (AA_DisableHighDpiScaling)\n"); printf("\tDebugging options:\n"); printf("\t-verbose ..................... Print information about what qml is doing, like specific file urls being loaded.\n"); printf("\t-translation [file] .......... Load the given file as the translations file.\n"); @@ -506,10 +505,10 @@ int main(int argc, char *argv[]) QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); } else if (arg == QLatin1String("-desktop")) { QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); -#if 0 // FIXME: 5.6: Re-enable once attribute naming is final (QTBUG-46615) + } else if (arg == QLatin1String("-scaling")) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); } else if (arg == QLatin1String("-no-scaling")) { - QCoreApplication::setAttribute(Qt::AA_NoHighDpiScaling); -#endif + QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); } else { files << arg; } diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 36a5c5ab76..0f73afcc7b 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -75,6 +75,10 @@ #include <qt_windows.h> #endif + +static const uint qtQmlMajorVersion = 2; +static const uint qtQmlMinorVersion = 2; + QString pluginImportPath; bool verbose = false; bool creatable = true; @@ -1056,9 +1060,13 @@ int main(int argc, char *argv[]) getDependencies(engine, pluginImportUri, pluginImportVersion, &dependencies); compactDependencies(&dependencies); - // load the QtQml 2.2 builtins and the dependencies + QString qtQmlImportString = QString::fromLatin1("import QtQml %1.%2") + .arg(qtQmlMajorVersion) + .arg(qtQmlMinorVersion); + + // load the QtQml builtins and the dependencies { - QByteArray code("import QtQml 2.2"); + QByteArray code(qtQmlImportString.toUtf8()); foreach (const QString &moduleToImport, dependencies) { code.append("\nimport "); code.append(moduleToImport.toUtf8()); @@ -1089,14 +1097,40 @@ int main(int argc, char *argv[]) QSet<const QMetaObject *> metas; if (action == Builtins) { + foreach (const QMetaObject *m, defaultReachable) { + if (m->className() == QLatin1String("Qt")) { + metas.insert(m); + break; + } + } + } else if (pluginImportUri == QLatin1String("QtQml")) { + bool ok = false; + const uint major = pluginImportVersion.split('.')[0].toUInt(&ok, 10); + if (!ok) { + std::cerr << "Malformed version string \""<< qPrintable(pluginImportVersion) << "\"." + << std::endl; + return EXIT_INVALIDARGUMENTS; + } + if (major != qtQmlMajorVersion) { + std::cerr << "Unsupported version \"" << qPrintable(pluginImportVersion) + << "\": Major version number must be \"" << qtQmlMajorVersion << "\"." + << std::endl; + return EXIT_INVALIDARGUMENTS; + } metas = defaultReachable; + foreach (const QMetaObject *m, defaultReachable) { + if (m->className() == QLatin1String("Qt")) { + metas.remove(m); + break; + } + } } else { // find a valid QtQuick import QByteArray importCode; QQmlType *qtObjectType = QQmlMetaType::qmlType(&QObject::staticMetaObject); if (!qtObjectType) { std::cerr << "Could not find QtObject type" << std::endl; - importCode = QByteArray("import QtQml 2.2"); + importCode = qtQmlImportString.toUtf8(); } else { QString module = qtObjectType->qmlTypeName(); module = module.mid(0, module.lastIndexOf(QLatin1Char('/'))); diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 53bd0bfbad..fc4fc3e167 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -356,9 +356,8 @@ static void usage() puts(" --desktop..........................Force use of desktop GL (AA_UseDesktopOpenGL)"); puts(" --gles.............................Force use of GLES (AA_UseOpenGLES)"); puts(" --software.........................Force use of software rendering (AA_UseOpenGLES)"); -#if 0 // FIXME: 5.6: Re-enable once attribute naming is final (QTBUG-46615) - puts(" --no-scaling.......................Disable High DPI scaling (AA_NoHighDpiScaling)"); -#endif + puts(" --scaling..........................Enable High DPI scaling (AA_EnableHighDpiScaling)"); + puts(" --no-scaling.......................Disable High DPI scaling (AA_DisableHighDpiScaling)"); puts(" --verbose..........................Print version and graphical diagnostics for the run-time"); puts(" -I <path> ........................ Add <path> to the list of import paths"); puts(" -P <path> ........................ Add <path> to the list of plugin paths"); @@ -453,10 +452,10 @@ int main(int argc, char ** argv) options.applicationAttributes.append(Qt::AA_UseSoftwareOpenGL); else if (!qstrcmp(arg, "--desktop")) options.applicationAttributes.append(Qt::AA_UseDesktopOpenGL); -#if 0 // FIXME: 5.6: Re-enable once attribute naming is final (QTBUG-46615) + else if (!qstrcmp(arg, "--scaling")) + options.applicationAttributes.append(Qt::AA_EnableHighDpiScaling); else if (!qstrcmp(arg, "--no-scaling")) - options.applicationAttributes.append(Qt::AA_NoHighDpiScaling); -#endif + options.applicationAttributes.append(Qt::AA_DisableHighDpiScaling); } foreach (Qt::ApplicationAttribute a, options.applicationAttributes) |