diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-07-01 01:00:48 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-01 10:29:06 +0200 |
commit | e6c6cc8fde26bd0b9d37a1812593f17df0b4159a (patch) | |
tree | 6aae6724e24a1e051d271e5f67baab5acc358313 /tools | |
parent | 16289f35eb08a9b9a6d56ea8dec549b1f17e4daf (diff) | |
parent | 3ecec55e534214aced70ccab7cc929cfb57738a2 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/imports/imports.pro
src/qml/qml/qqmlmetatype.cpp
Change-Id: I308436caf55402cb2246cb591c6ac8f83e1febf8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlcachegen/generateloader.cpp | 7 | ||||
-rw-r--r-- | tools/qmlscene/main.cpp | 44 |
2 files changed, 29 insertions, 22 deletions
diff --git a/tools/qmlcachegen/generateloader.cpp b/tools/qmlcachegen/generateloader.cpp index 5b8fc34455..4fbbb27afb 100644 --- a/tools/qmlcachegen/generateloader.cpp +++ b/tools/qmlcachegen/generateloader.cpp @@ -365,6 +365,7 @@ bool generateLoader(const QStringList &compiledFiles, const QStringList &sortedR stream << "struct Registry {\n"; stream << " Registry();\n"; + stream << " ~Registry();\n"; stream << " QHash<QString, const QQmlPrivate::CachedQmlUnit*> resourcePathToCachedUnit;\n"; stream << " static const QQmlPrivate::CachedQmlUnit *lookupCachedUnit(const QUrl &url);\n"; stream << "};\n\n"; @@ -387,7 +388,11 @@ bool generateLoader(const QStringList &compiledFiles, const QStringList &sortedR if (!resourceRegisterCall.isEmpty()) stream << resourceRegisterCall; - stream << "}\n"; + stream << "}\n\n"; + stream << "Registry::~Registry() {\n"; + stream << " QQmlPrivate::qmlunregister(QQmlPrivate::QmlUnitCacheHookRegistration, quintptr(&lookupCachedUnit));\n"; + stream << "}\n\n"; + stream << "const QQmlPrivate::CachedQmlUnit *Registry::lookupCachedUnit(const QUrl &url) {\n"; stream << " if (url.scheme() != QLatin1String(\"qrc\"))\n"; stream << " return nullptr;\n"; diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 312b180df5..d3b8b9ba99 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -481,6 +481,12 @@ int main(int argc, char ** argv) options.applicationAttributes.append(Qt::AA_EnableHighDpiScaling); } else if (!qstrcmp(arg, "--no-scaling")) { options.applicationAttributes.append(Qt::AA_DisableHighDpiScaling); + } else if (!qstrcmp(arg, "--transparent")) { + options.transparent = true; + } else if (!qstrcmp(arg, "--multisample")) { + options.multisample = true; + } else if (!qstrcmp(arg, "--core-profile")) { + options.coreProfile = true; } else if (!qstrcmp(arg, "--apptype")) { if (++i >= argc) usage(); @@ -489,6 +495,23 @@ int main(int argc, char ** argv) } } + if (qEnvironmentVariableIsSet("QMLSCENE_CORE_PROFILE")) + options.coreProfile = true; + + // Set default surface format before creating the window + QSurfaceFormat surfaceFormat; + surfaceFormat.setStencilBufferSize(8); + surfaceFormat.setDepthBufferSize(24); + if (options.multisample) + surfaceFormat.setSamples(16); + if (options.transparent) + surfaceFormat.setAlphaBufferSize(8); + if (options.coreProfile) { + surfaceFormat.setVersion(4, 1); + surfaceFormat.setProfile(QSurfaceFormat::CoreProfile); + } + QSurfaceFormat::setDefaultFormat(surfaceFormat); + for (Qt::ApplicationAttribute a : qAsConst(options.applicationAttributes)) QCoreApplication::setAttribute(a); QScopedPointer<QGuiApplication> app; @@ -503,9 +526,6 @@ int main(int argc, char ** argv) QCoreApplication::setOrganizationDomain(QStringLiteral("qt-project.org")); QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - if (qEnvironmentVariableIsSet("QMLSCENE_CORE_PROFILE")) - options.coreProfile = true; - const QStringList arguments = QCoreApplication::arguments(); for (int i = 1, size = arguments.size(); i < size; ++i) { if (!arguments.at(i).startsWith(QLatin1Char('-'))) { @@ -516,8 +536,6 @@ int main(int argc, char ** argv) options.maximized = true; else if (lowerArgument == QLatin1String("--fullscreen")) options.fullscreen = true; - else if (lowerArgument == QLatin1String("--transparent")) - options.transparent = true; else if (lowerArgument == QLatin1String("--clip")) options.clip = true; else if (lowerArgument == QLatin1String("--no-version-detection")) @@ -530,10 +548,6 @@ int main(int argc, char ** argv) options.translationFile = QLatin1String(argv[++i]); else if (lowerArgument == QLatin1String("--resize-to-root")) options.resizeViewToRootItem = true; - else if (lowerArgument == QLatin1String("--multisample")) - options.multisample = true; - else if (lowerArgument == QLatin1String("--core-profile")) - options.coreProfile = true; else if (lowerArgument == QLatin1String("--verbose")) options.verbose = true; else if (lowerArgument == QLatin1String("-i") && i + 1 < size) @@ -627,18 +641,6 @@ int main(int argc, char ** argv) return -1; } - // Set default surface format before creating the window - QSurfaceFormat surfaceFormat; - if (options.multisample) - surfaceFormat.setSamples(16); - if (options.transparent) - surfaceFormat.setAlphaBufferSize(8); - if (options.coreProfile) { - surfaceFormat.setVersion(4, 1); - surfaceFormat.setProfile(QSurfaceFormat::CoreProfile); - } - QSurfaceFormat::setDefaultFormat(surfaceFormat); - QScopedPointer<QQuickWindow> window(qobject_cast<QQuickWindow *>(topLevel)); if (window) { engine.setIncubationController(window->incubationController()); |