aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Android multiarch supportBogDan Vatra2019-08-281-2/+8
| | | | | Change-Id: Ifa70d6cb36be385280364cca9dd4e31b43aa9a18 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix bug in QQmlEngine::setImportPathList() when it had a resource pathJan Arve Sæther2019-07-301-1/+3
| | | | | | | | | | | | | | | | | | The bug is really in QQmlImportDatabase::setImportPathList(). It was missing the same conversions that was done in QQmlImportDatabase::addImportPath(), so it failed to use a resource path as a import path because it did not convert ":/foo" to "qrc:/foo". We therefore just use addImportPath() to ensure the paths are converted properly. Before this, several autotests in tests/auto/qml/qqmllanguage failed on Android, since they were calling QQmlEngine::setImportPathList() where the list had resource paths. Task-number: QTBUG-73512 Change-Id: Idc64f5ad20ec665df7cb57ea1c346bc0975c3b0d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-261-1/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/handlers/qquickpointerdevicehandler.cpp src/quick/scenegraph/qsgdefaultglyphnode.cpp src/quick/scenegraph/qsgdefaultglyphnode_p.cpp src/quick/scenegraph/qsgdefaultglyphnode_p_p.h tests/auto/qml/qjsengine/tst_qjsengine.cpp Done-With: Jan Arve Sæther <jan-arve.saether@qt.io> Done-With: Laszlo Agocs <laszlo.agocs@qt.io> Change-Id: I35749152f8dce44b9af8d52b1283629879010f11
| * Do not search for Singletons from more recent versionsFabian Kosmale2019-07-231-1/+12
| | | | | | | | | | | | | | | | | | | | This would break importing older versions of a module, as we would try to locate a singleton which does not exist in this version. Fixes: QTBUG-77102 Change-Id: I78be1ec111d2be26a14b2a94bbf743cf6238cddd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Split qqmltypeloader{_p.h|.cpp} into a several filesUlf Hermann2019-07-111-0/+1
| | | | | | | | | | | | | | No one can read this mess. Change-Id: Icec4f2afc466435c1ae5e4e80fa2c1b5baf7d087 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Clean up the QT_CONFIG(library) conditionsUlf Hermann2019-06-261-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | We can clear the engine plugins when compiled without library support as those might be static plugins. However, explicitly loading a dynamic plugin is pointless if compiled without library support. We can just disable the whole function. Furthermore, the ability to load dynamic qmldir plugins does not depend on Qt being compiled as shared library but rather on library support being available. Change-Id: I8553706f0f8f5bd4e98cc130bf56c4526f81b85f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Inline msgCannotLoadPlugin() into its only callerUlf Hermann2019-06-241-9/+4
| | | | | | | | | | Change-Id: I104f8776d34f4db2afe9d1940aa621a6a0b3892a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-181-1/+1
|\| | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp Change-Id: I6add6267297ea50a646d43d212027a168dca8916
| * QML: Allow fetchOrCreateTypeForUrl to report errors without qFatalErik Verbruggen2019-04-161-1/+1
| | | | | | | | | | | | | | | | Because qFatal will abort() the program. Task-number: QTBUG-71116 Change-Id: Ifd6be996cfbd6fff8e75ad2b26682c34f837ac88 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-101-1/+1
|\| | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp src/qml/types/qqmlmodelsmodule.cpp Change-Id: Idc63689ba98d83a455283674f4b5cf3014473605
| * Avoid redundant slashes when creating qmldir URLsUlf Hermann2019-03-281-1/+1
| | | | | | | | | | | | | | | | | | If the path starts with ":" and we assume it's an absolute qrc path, the only thing we need to do to make it a URL is prepend "qrc". Fixes: QTBUG-74677 Change-Id: Iee0239296b6f48ce909db02ae16e24dfc745b637 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QML: Delete plugin loaders on shutdownUlf Hermann2019-03-281-0/+7
| | | | | | | | | | | | | | | | | | The StringRegisteredPluginMap owns its QPluginLoaders. Therefore, it should delete them in the end. ASAN complains if not. Change-Id: Iecd425e340d13db5cecd44bb123818e2c2a3b6a5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Merge remote-tracking branch 'origin/5.13' into HEADUlf Hermann2019-03-221-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compileddata_p.h src/qml/jit/qv4baselinejit.cpp src/qml/jit/qv4jithelpers.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4runtimeapi_p.h src/qml/jsruntime/qv4vme_moth.cpp src/qml/qml/qqmltypemodule_p.h Change-Id: If28793e9e08418457a11fc2c5832f03cab2fcc76
| * Create import directory from intercepted URL, not orignial oneUlf Hermann2019-03-201-1/+1
| | | | | | | | | | | | | | | | | | If the qmldir URL got intercepted, we should use the intercepted URL to get to the contents to be loaded. Fixes: QTBUG-73843 Change-Id: I51715575e767ed429a8237517f47196677409fe0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Move registration functions from qqmlimport.cpp to qqmlmetatype.cppUlf Hermann2019-02-081-157/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions require the metatype data in multiple interdependent places. If they are executed concurrently data races are almost guaranteed. Move the functions to qqmlmetatype.cpp and keep the metatype mutex locked for their duration. Access to the internals of the metatype system also allows us to significantly simplify the logic. Additionally we can remove methods only used by those functions from the public interface of QQmlMetaType now. Task-number: QTBUG-73271 Change-Id: I1279259cca5cb5be63026d5b74f5d013e7a1ac5c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add a mutable iterator to QStringHashUlf Hermann2019-02-071-2/+2
| | | | | | | | | | | | | | And use that in QQmlTypeModule to get rid of a const_cast. Change-Id: Ifbb39293b6f0e159355dd7780febba0eed149025 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QML: Split qqmlmetatype{_p.h|.cpp} into multiple filesUlf Hermann2019-02-061-0/+2
|/ | | | | | | | Having all those classes in one big file promotes spaghetti code and makes the code unreadable. Change-Id: I3b6df93b9cfe1d97228771049b3054e78b868ea3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix qmlplugindump version dump issueMichal Policht2018-11-231-5/+10
| | | | | | | | | | Changed major and minor version of created QQmlType. Using major and minor version of a candidate instead of major and minor versions passed to a function. Task-number: QTBUG-67292 Change-Id: I2c30f5e8f49aa0be3a1d5b404ab16eb376ad8092 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML TypeLoader: Sort composite singletons before recursing into themUlf Hermann2018-11-201-0/+14
| | | | | | | | | | | | | | | | | When recursingly loading further types for composite singletons before sorting them, the order in which the recursively referenced types are loaded is random because the composite singletons are kept in an (unordered) hash. Any sorting after loading the child components doesn't help as the recursive references may depend on the types already loaded at that point. Sorting the composite singletons before starting the recursion does help because it eliminates the source of randomness in the system. Fixes: QTBUG-66976 Change-Id: I0fa1f50b36eba8c73eb8d56b4d5118485ab05f35 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove hardcoded Q_OS_WASM “qml/” import pathMorten Johan Sørvig2018-09-121-7/+1
| | | | | | | | | | The qrc resources path is sufficient for now. This reverts parts of commit eb6201b2af725d64e5e92f19a512b1ff23ceba51 Change-Id: I400eb36edf0035f8ad6a4bbd04da9f81701bef89 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Optimize QQmlImportInstance::resolveType()Lars Knoll2018-09-051-8/+12
| | | | | | | | | | | Optimize the case where the import is not a library and tries to find the type on disk. Avoid lots of conversions to and from QUrl and related string processing. Change-Id: Ife247d8adf5ec63127596f2c5ba16a56562ab84a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* WebAssembly for QtDeclarativeMorten Johan Sørvig2018-09-051-1/+7
| | | | | | | | This is the squashed diff from wip/webassembly to 5.12. Done-with: Lorn Potter <lorn.potter@gmail.com> Change-Id: Ieef34accefef38018a66d3c39bfacb825af4bea6 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-06-291-7/+7
|\ | | | | | | Change-Id: I800f39ea59efd6049d3226ec27b8ecb3f6e9ae28
| * Show error message when type qmlRegisterType and friends failErik Verbruggen2018-06-261-7/+7
| | | | | | | | | | | | | | | | | | When a type is registered through qmlRegisterType or similar functions, no error was shown. Task-number: QTBUG-68323 Change-Id: Iff44bf8744c67dba2fdd12c43aaee44a8e15364a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Ensure we read context properties before the global objectLars Knoll2018-06-171-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also global variables declared in a .pragma library script should not be saved in the global object, as the script has it's on context where those variables live. [ChangeLog][QtQml] Properties of the JS global object will now be looked up after local properties in the QML object. This can lead to runtime incompatibilities if your qml file is named the same as a property of the global object (e.g. Date.qml). Task-number: QTBUG-51581 Change-Id: I108aea4c76d088ca8c2124700f91e8eac3fc19f3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix QQmlExtensionPlugin::baseUrl() in static buildsJ-P Nurmi2018-05-151-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | Don't assume the file system. Everything is bundled into resources in static builds. For example, for the QML modules in Qt, the base URL was "file::/qt-project.org/imports/QtFoo/Bar". This patch fixes it so that the base URL becomes "qrc:/qt-project.org/imports/QtFoo/Bar". This fix removes the need for this type of special casing in QQC2 when resolving the URL for qmlRegisterType() for internal QML composite types: #ifdef QT_STATIC QString url = QLatin1String("qrc") + baseUrl().path(); #else QString url = baseUrl().toString(); #endif The piece of code originates from QQC2 commit(s) e3c52b2 (and 199962a) that were presumably fixing support for static builds. Change-Id: I4fff354c3ed5309843e9122a0175593f4fbb5661 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash when calling QQmlEngine::clearComponentCache()Simon Hausmann2018-03-191-31/+31
| | | | | | | | | | | | | | | | We must protect various resources in the type loader with our existing lock. The QQmlTypeLoaderQmldirContent is now value based, so that we can release the lock on the shared cache early. Copying it involves adjusting the refcount of the QHash and QString instances in the QQmlDirParser. The safety of this was verified with a TSAN build and the example supplied in the task. It crashed reliably with TASN errors first and with this patch it runs without errors. Task-number: QTBUG-41465 Change-Id: I616843c4b8bdfd65d1277d4faa8cb884d8e77df8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-12/+12
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.10' into 5.11Liang Qi2018-02-121-66/+84
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/shapes/qquickshape.cpp src/imports/shapes/qquickshape_p_p.h src/qml/compiler/qqmlpropertycachecreator_p.h src/qml/jsruntime/qv4value_p.h src/quick/items/qquickloader_p.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tools/qmlprofiler/qmlprofilerapplication.cpp Change-Id: Iafc66ae84bf78630ed72a986acb678e9d19e3a69
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-02-021-66/+84
| |\ | | | | | | | | | Change-Id: I41ca9120a470a905c2f5c168c1de4cf970fa0fff
| | * Fix dead lock / race in QML type loader when importing pluginsSimon Hausmann2018-02-021-66/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When importing modules - in the QML loader thread - with plugins we keep globally track of the Qt plugins that we have loaded that contain QML modules, to ensure that we don't call the engine-independent registerTypes() function on the plugin multiple times. After registerTypes() we may also call initializeEngine() on the plugin for the engine-specific initialization, which - as a QQmlEngine is provided as parameter - must happen in the gui thread. For that we issue a thread-blocking call that waits until the gui thread has woken up and processed the event/call. During that time the global plugin lock is held by that QML loader thread. If meanwhile the gui thread instantiates a second QQmlEngine and attempts to issue a synchronous type compilation (using QQmlComponent::CompilationMode::PreferSynchronous), then gui thread is blocking and waiting for its own QML loader thread to complete the type compilation, which may involve processing an import that requires loading a plugin. Now this second QML loader thread is blocked by trying to acquire the global plugin registry lock (qmlEnginePluginsWithRegisteredTypes()->mutex) in qqmlimports.cpp. Now the first QML loader thread is blocked because the gui thread is not processing the call events for the first engine. The gui thread is blocked waiting for the second QML loader thread, which in turn is stuck trying to acquire the lock held by the first QML loader thread. The provided test case triggers this scenario, although through a slightly different way. It's not possible to wait in the gui thread for the plugin lock to be held in a loader thread via the registerTypes callback, as that also acquires the QQmlMetaType lock that will interfere with the test-case. However the same plugin lock issue appears when the first QML engine is located in a different thread altogether. In that case the dispatch to the engine thread /works/, but it won't be the gui thread but instead the secondary helper thread of the test case that will sit in our initializeEngine() callback. This bug was spotted in production customer code with backtraces pointing into the three locations described above: One QML loader thread blocking on a call to the gui thread, the gui thread blocking on a second QML loader thread and that one blocking on acquisition of the plugin lock held by the first. Fortunately it is not necessary to hold on to the global plugin lock when doing the engine specific initialization. That allows the second QML loader thread to complete its work and finally resume the GUI thread's event loop. Change-Id: If757b3fc9b473f42b266427e55d7a1572b937515 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | doc: Fix qdoc warnings for templates and staticsMartin Smith2018-02-091-3/+3
|/ / | | | | | | | | | | | | | | | | | | Several \fn commands needed template parameters added, and several static functions that were not accessible were documented but should not have been documented. The template texts were added and the qdoc comments of the static functions were changed to non-qdoc comments. Change-Id: Icc44e243fbec2023865f47b7c73dc15d241d5b4d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-041-4/+27
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/memory/qv4mm.cpp src/qml/memory/qv4mmdefs_p.h src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp Change-Id: I7021fa1edf076627a67048f41f7b201220262b09
| * Don't reject plugin-only qmldir filesUlf Hermann2017-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | On QQmlImportsPrivate::updateQmldirContent we need to check if the new module has actually been established after figuring out that it doesn't have any components or scripts. If it has, then we shouldn't fail, as obviously a plugin has been loaded. We don't need to check the component and script versions in that case, as plugins don't have separate versions. Change-Id: Ie328b59038fe65c3f6a2eeecfe969927bba6cd68 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix URL interception for qmldir filesUlf Hermann2017-11-221-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to intercept the URL when it is created. This relieves us of the need to hack around in it when actually retrieving the content of the qmldir file and prevents the futile attempt to load remote qmldir files via the code path that should load local ones (or vice versa). The back and forth conversion between URLs and strings is unfortunate, but can only be solved by using QUrl rather than QString where we actually mean URL. This would be a bigger change which is unsuitable for 5.9. Mind that nothing changes for code that doesn't use URL interceptors. Task-number: QTBUG-36773 Change-Id: I6bff3ae352009fdc0a17ec209691c7b390367f11 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix QQmlImportsPrivate::resolvedUri()v5.10.0-rc3v5.10.0J-P Nurmi2017-11-301-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Qt Quick Controls 2 styles have a version in the middle of the path/URI (e.g. qml/QtQuick/Controls.2/Material). The resolvedUri() helper method, which is used by addFileImport() for implicit imports, was never taught to deal with this type of versioning. It was only attempting to remove the version from the end. Change-Id: Ibdf23dc6c3b0794527d5f9330602858291c23e01 Task-number: QTBUG-64868 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Check for duplication with url rather than uriMichael Brasser2017-11-081-1/+1
| | | | | | | | | | | | | | | | | | We might have duplicated uris with different paths. This comparison is meant to check for multiple imports of the same path. Change-Id: I2d99728d32116453ae92a152337d2627c2653b79 Task-number: QTBUG-64237 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-241-19/+42
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmltypenamecache.cpp Done-with: Ulf Hermann<ulf.hermann@qt.io> Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
| * Tell QQmlImportInstance::resolveType what kind of type we wantUlf Hermann2017-10-191-16/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQmlTypeData::resolveTypes() we know if we're looking at a reference to a composite singleton type, or some other type reference. When we call resolveType() we expect the correct type to be returned, not only based on URL, but also based on its singleton property. QQmlTypeData::resolveType() eventually invokes QQmlImportInstance::resolveType() which will call fetchOrCreateTypeForUrl(), passing a parameter on whether the result should be a composite singleton. When operating on a qmldir component the component itself encodes this. When fetching a type from a local file without qmldir, we currently assume that it isn't a singleton, no matter QQmlTypeData::resolveTypes() has determined. This means that actual singletons loaded this way later get refused by the sanity check. In order to fix this, pass the information about the expected singleton property on to QQmlImportInstance. This is done using QQmlType::RegistrationType, which gets another entry for "any type". If the expected type is CompositeSingletonType QQmlTypeData::resolveType() will not create a non-singleton type. If it is any specific other type, it will not create a composite singleton. And if it is AnyRegistrationType, it will behave as it previously did. Change-Id: I6b7e082b63582e0aed946bb3d19077b94c7a45f7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix implicit loading of internal types when using explicit importsSimon Hausmann2017-09-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QQC Android style has a type that is intended to be internal only and it's loaded implictly (see bug report for details). However the qml file also has to import the module explicitly in order to get access to the singleton the module provides. The documentation says that types of a module are to be specified in the qmldir file, otherwise they are derived from the file name. With commit 22a2cc43387ec3b9f74a6c01f8665378a4541147 that become an exclusive relationship with regards to types from implicit imports. The proposed solution for the JIRA task is to mark the types that are needed internally as "internal" in the qmldir file and fix support for loading internal types through implicit imports (which is what this commit fixes). Task-number: QTBUG-63309 Change-Id: Id696a691f1af1d335c7c8d72f2627064c3d7b9ac Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-09-201-0/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4regexpobject_p.h src/qml/types/qqmllistmodel.cpp src/quick/items/qquickanimatedimage_p.h src/quick/scenegraph/qsgrenderloop.cpp tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
| * Fix qml cache invalidation when changing dependent C++ registered QML singletonsSimon Hausmann2017-09-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a qml file uses a qml singleton, we need to reliably detect when the singleton changes and re-generate the cache of the qml file using it. This is a scenario covered and fixed by commit 5b94de09cc738837d1539e28b3c0dccd17c18d29, with the exception that currently QML singletons registered via qmlRegisterSingleton were not added to the list of dependent singletons for a qml file. We can fix this by extending findCompositeSingletons() to also cover the singletons that do not originate from a qmldir file. [ChangeLog][Qt][Qml] Fixed bug where sometimes changes to a qml singleton would not propagate to the users or cause crashes. Task-number: QTBUG-62243 Change-Id: I16c3d9ba65fd82e898a29b946c341907751135a9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Use the qEnvironmentVariable function from QtCoreThiago Macieira2017-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | This corrects the encoding of QML2_IMPORT_PATH environment variable, since it contains paths. For the other cases, it's just improving the code. Task-number: QTBUG-62328 Change-Id: I0f2ce894387048f78465ffff141ca50208f6845a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-08-181-30/+33
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/qml/qqmlcustomparser.cpp src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypenamecache.cpp src/qml/qml/qqmltypenamecache_p.h src/qml/qml/qqmltypewrapper.cpp src/qml/qml/qqmltypewrapper_p.h src/qml/qml/qqmlvmemetaobject.cpp src/qml/util/qqmladaptormodel.cpp Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131
| * Fix void * usage in our internal APIsLars Knoll2017-08-021-1/+2
| | | | | | | | | | | | Task-number: QTBUG-61536 Change-Id: Ia2b5cfeab093d8be91728032528788dd238c2872 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Remove unused types on engine destructionSimon Hausmann2017-08-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The QML engine destructor as well as trimComponentCache() do now clean out unused composite types that the engine registered internally. This helps avoid 'static' leaks, when more and more types would get registered by the engine. Task-number: QTBUG-61536 Change-Id: I5b32af4b88fbf626de8c0bfbaedb2285b09e3679 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Use QQmlType by valueLars Knoll2017-08-021-27/+29
| | | | | | | | | | | | | | | | | | | | | | QQmlType is now refcounted, and we need to use it by value, to control it's lifetime properly. This is required, so we can clean up the QQmlMetaTypeData cache on engine destruction and with trimComponentCache() Task-number: QTBUG-61536 Change-Id: If86391c86ea20a646ded7c9925d8f743f628fb91 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-07-281-2/+2
|\| | | | | | | Change-Id: I7d092cce33cb009d63e7b0df7c71183089dea53f
| * Fix loading of QML plugins with old IID in static buildsSimon Hausmann2017-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit 709f6370884b110def2e4665df8fa7bbf5fae734 we required the use of QQmlExtensionInterface_iid in qml plugins for static linkage. This mean that plugins using the "/1.0" variant would also continue to load, but those not would fail to load. This is annoying when porting apps from older Qt versions. To make the upgrade path easier, let's just support both IIDs. [ChangeLog][Qml] Fix loading of static qml plugins using the old plugin interface id Change-Id: I1c662b1fedad3f32b7dea1eddc32838d2eb9f3be Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add support for enum declarations in QMLMichael Brasser2017-07-131-10/+26
|/ | | | | | | | | | | | | | | | | Enums can be declared with the following syntax: enum MyEnum { Value1, Value2 } Grammar changes done by Simon Hausmann. [ChangeLog][QtQml] Enums can now be declared directly in QML. Task-number: QTBUG-14861 Change-Id: Ic6b6e032651d01ee2ecf9d5ce5734976cb3ad7ab Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>