aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport_p.h
Commit message (Collapse)AuthorAgeFilesLines
* qqmlimport: Log when no qmldir file is foundAlexandru Croitor2022-03-161-1/+14
| | | | | | | | | | | | | | Also log when it is found, with the path where it is found. As a drive-by, add a 'version' label before printing the version of an imported library. In a static build where some libraries end up with a version set to 'invalid', it's clearer that the version is invalid, and not the library. Change-Id: I998776b13bfe98f1668790419f1102e081878c99 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 22b69dae253981b67124fc38adab666eb2d750be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid querying the file system for qmldir files for locked modulesUlf Hermann2021-08-171-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user explicitly locks a module using qmlProtectModule, we don't load any additional qmldir files afterwards. In particular, this means you can only do that with modules that don't contain qmldir files or with modules for which the qmldir files have already been loaded in all engines that need them. This is in contrast to the "weak" locking we automatically perform when loading a plugin. When importing the module again after loading a plugin we do want to re-evaluate the qmldir directives. If the module is imported from a different engine than before, we also have to search for the qmldir file again. Amends commit 914e0300792856ddac9b99b20a8d88dd6f087fa6. [ChangeLog][QtQml] The pre-5.15 behavior of qmlProtectModule() has mostly been restored: If you explicitly protect a module, the QML engine will never look for any qmldir files or plugins for that module again. This severely limits what you can do with such a module. However, once all affected engines have loaded the module, protecting it can be a useful optimization. In contrast to pre-5.15, the qmldir cache for such modules continues to be re-used even after they are locked. Therefore, in QML engines that have loaded the module before, you can expect any "prefer" or "import" directives and any composite types to still be available after protecting the module. Fixes: QTBUG-85591 Pick-to: 6.2 Change-Id: Ia4edd860e2ddda5e0c419e1ce9764f10f32ace1f Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* Fix qmldir cache inconsistencyJaeyoon Jung2021-07-161-27/+26
| | | | | | | | | | | | | If there are multiple qmldir entries for the same QML module in the import list, the one that comes first should take precedence. The same applies when constructing the qmldir cache. We can achieve that by inserting the entries into the cache in the same order they appear in the completeQmldirPaths list. Pick-to: 6.2 Change-Id: Ic56a0952b16c4be016180c695d79089fc132319a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Completely cache the result of qmldir searchesUlf Hermann2021-07-051-3/+11
| | | | | Change-Id: Ib6a41c8d20b1443d8d4296190c007f4627086602 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Key plugins by URI where possibleUlf Hermann2021-06-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | This allows us to associate different qmldir files for the same module with one another. Typically there is one qmldir file in the resource file system and one in the QML import path. We cannot load plugins for the latter, but usually we have already loaded any plugins we need. Now we can detect this. This requires us to construct a proper URI for implicit imports. The easiest way to do this is to just use the URI from the qmldir if available. Modules with versions encoded in their paths and modules with multiple plugins cannot be resolved by URI only. These continue to be keyed by path. However, as we do not generate such modules, we will not automatically get two instances of those, and we won't have to fall back from one to the other. Pick-to: 6.2 Change-Id: Ic79add936d263a8e559fd998fca15a6ae160952e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move locateLocalQmldir and make it a templateUlf Hermann2021-06-291-10/+115
| | | | | | | | | | | | | | | It conceptually belongs into QQmlImportDatabase because it messes with the qmldir cache. This way, if we reject a qmldir file for whatever reason, we can still check for further matching qmldir files in other places. We might, for example determine that we need to load a plugin, but we have been given a qmldir file in the resource file system. In that case, we want to check for other instances of the same module in the host file system. Pick-to: 6.2 Change-Id: I8fe4a0f188f3732b9d10d017a94562e8bd1fb242 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Refactor plugin loading into a separate classUlf Hermann2021-06-281-14/+4
| | | | | | | | | | | The methods that load the plugins were suffering from an excessive number of parameters, and were dispersed across several classes. Concentrating them in one place and transforming all the parameters into members makes the code more readable and easier to extend. Pick-to: 6.2 Change-Id: I67e4f49567ad37363a0f38d8f7773de863856554 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlImport: Don't cache localDirectoryPathUlf Hermann2021-03-011-1/+0
| | | | | | | It's only used in one place. We can just calculate it there. Change-Id: If9d1c7e6a6fc012eeba8fff9ce24d3c4b149c914 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Match specific module imports also for versionless QML importsUlf Hermann2020-06-291-17/+18
| | | | | | | | | | Previously, if you registered a module import for a specific version X of a module, and the user imported the module without specifying a version, the module import would not be carried out even if X was the version actually imported. Change-Id: I853ed6f275501cf4cbd4e5a360985e67b07f3773 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Fix precedence of module importsUlf Hermann2020-06-111-2/+4
| | | | | | | | Types imported transitively via a qmldir import statement should not shadow types available from the module itself. Change-Id: Id34edc5c5e2fff4ba37009f4bab9039b7ed18dff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow QML plugins to be optionalUlf Hermann2020-06-091-3/+1
| | | | | | | | | | | If a plugin does nothing but load the library that provides the types, we can skip the plugin loading by linking the library directly. State that in the qmldir file, and evaluate it when loading the module. Task-number: QTBUG-84639 Change-Id: I2097237866a50f66c55e4653ad119fe10e18a893 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlImport: Make plugin resolution functions const and publicUlf Hermann2020-06-051-4/+4
| | | | | Change-Id: If21f788807cbcf5b134a9af5713eec6ec60fb362 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-181-0/+5
|\ | | | | | | | | | | | | Conflicts: tools/qmllint/findunqualified.cpp Change-Id: I2593b5cc0db1d14e0c944aec4b88a80f46f5b0c1
| * Prefer Inline Components over any other imported nameFabian Kosmale2020-03-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | After processing all other imports, there might be other imports both in front and behind of the inline component imports in the import list. To avoid having to search for them, we sort the list so that they are in front. Fixes: QTBUG-82302 Change-Id: I9f6deb03608b1ebd0cbe0eddd1a1e5d39837a783 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-19/+21
|/ | | | | | | | | | | | | | In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live QML inline componentsFabian Kosmale2020-01-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] It is now possible to declare new QML components in a QML file via the component keyword. They can be used just as if they were declared in another file, with the only difference that the type name needs to be prefixed with the name of the containing type outside of the file were the inline component has been declared. Notably, inline components are not closures: In the following example, the output would be 42 // MyItem.qml Item { property int i: 33 component IC: Item { Component.onCompleted: console.log(i) } } // user.qml Item { property int i: 42 MyItem.IC {} } Fixes: QTBUG-79382 Change-Id: I6a5ffc43f093a76323f435cfee9bab217781b8f5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Defer loading of local qmldir files when intercepted to remote onesUlf Hermann2020-01-021-3/+9
| | | | | | | | | | | | The qqmltypeloader test checks this case. As long as the types are actually loaded by the plugin it worked as we didn't register the module before. When the types are loaded by static type registrations in QtQuick we need to detect whether we still need to wait for a remote qmldir file to appear in order to load color providers etc. Change-Id: I7aa10903c6c23d1c9be01ee7ddafbdc696975407 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for primitive self-references in composite typesSimon Hausmann2019-10-211-3/+2
| | | | | | | | | | | This has been long missing and will also help with the implementation of inline components and the referenced bugs. Done-with: Fabian Kosmale <fabian.kosmale@qt.io> Task-number: QTBUG-41087 Task-number: QTBUG-35910 Change-Id: Ia42a8f9808ece543f8ce2314b3352507fab22c62 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Provide methods to query and remove a dynamically loaded pluginUlf Hermann2019-10-161-1/+3
| | | | | | | | | | This may be necessary in some corner cases in order to manually manage memmory for loaded libraries. Also, clear the (static) plugins on qmlClearTypeRegistrations if !QT_CONFIG(library). Task-number: QTBUG-76074 Change-Id: Id33d2a4acd7ca94efad53353f8bcb020576c4010 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for semi-automatic QML type registrationsUlf Hermann2019-10-141-0/+1
| | | | | | | | | | | | | | | We can use the new moc JSON output to collect all meta-objects at build time and, for those that include QML element registration meta-data, generate code that automatically registers these types with QML. This eliminates the need to call qmlRegisterType manually. For now this generates free-standing functions (per module) that need to be called manually. This is intended as an intermediate step. Task-number: QTBUG-68796 Change-Id: Ib414eef9757344feee488ebc7388f957b975347f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use qmlProtectModule to protect a module from further modificationUlf Hermann2019-10-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | We don't need two mechanisms to do essentially the same thing. QQmlTypeLoader::Blob::addImport() had an "optimization" to never check for qmldir files of locked imports. This meant the first time you imported a module with a plugin that locked the module you could use the qmldir file to load additional .qml files afterwards. The second time you imported the same thing, you couldn't. As this is not a great example of consistent behavior, we drop this optimization and always allow the qmldir files of plugins that lock the module to specify additional QML files. As a side effect of this, additional plugins listed in a qmldir file can also now be loaded after the module has been locked by some other means. However, any qmlRegisterFooBar() called from the module will be prevented. Change-Id: Idabb2bd5f75fc85b62f42625173672b4ae84382e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Clean up the QT_CONFIG(library) conditionsUlf Hermann2019-06-261-0/+2
| | | | | | | | | | | | | 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>
* Simplify errors and diagnosticsUlf Hermann2019-06-141-0/+1
| | | | | | | | | | | | | | | | We only need two classes to describe all possible diagnostics: * A low-level private POD DiagnosticMessage. This is easily copied and passed around internally. It doesn't need to adhere to a stable API and it doesn't carry any extra baggage. * The high-level public QQmlError with its stable interface. This can internally also use a DiagnosticMessage as storage. Change-Id: I52be88d9b5d9855a661b8032b01eedb43a0fb0b3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move QStringHash into its own fileUlf Hermann2019-02-061-1/+1
| | | | | | | QHashedString and QStringHash are different things. Change-Id: Ifcac58ef41bf15dd6172fa0c42b86eca385c2ce0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QML: Split qqmlmetatype{_p.h|.cpp} into multiple filesUlf Hermann2019-02-061-1/+1
| | | | | | | | 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>
* Optimize QQmlImportInstance::resolveType()Lars Knoll2018-09-051-0/+1
| | | | | | | | | | | 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>
* Ensure we read context properties before the global objectLars Knoll2018-06-171-1/+2
| | | | | | | | | | | | | | | 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 crash when calling QQmlEngine::clearComponentCache()Simon Hausmann2018-03-191-1/+1
| | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | | | | 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.9' into 5.10Liang Qi2018-01-041-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix URL interception for qmldir filesUlf Hermann2017-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-241-2/+8
|\| | | | | | | | | | | | | | | | | | | 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-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 devSimon Hausmann2017-08-181-6/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Use QQmlType by valueLars Knoll2017-08-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Add support for enum declarations in QMLMichael Brasser2017-07-131-3/+10
|/ | | | | | | | | | | | | | | | | 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>
* QQmlImport: Decouple QQmlImportNamespace & Import type from qqmlimport.cppRobin Burchell2017-01-261-0/+42
| | | | | | | | | Using nested types means we cannot forward declare them, which is basically a prerequisite for using these classes anywhere else. As we want to do that for QQmlTypeLoader, let's untangle the knot. Change-Id: I05fff3521cda553965ae3368eb3731265bf46a9c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Allow target path version in a parent moduleJ-P Nurmi2016-04-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, the QML Engine is now able to locate QtQml.Models 2.x in both of the following target/installation paths: - QT_INSTALL_QML/QtQml/Models.2 - QT_INSTALL_QML/QtQml.2/Models This is required for QtQuick Controls 2. The target path of the module is QT_INSTALL_QML/QtQuick/Controls.2. The built-in styles are installed as sub-directories to be able to locate them from the controls module. Some of the built-in styles provide their own C++ extensions via style- specific imports (eg. the Material attached property is imported from QtQuick.Controls.Material 2.0). The problem is that the QML Engine does not find the module from QT_INSTALL_QML/QtQuick/Controls.2/Material, but requires it to be installed outside the main controls module ie. QT_INSTALL_QML/QtQuick/Controls/Material(.2). This makes it a) hard to locate the styles from the main controls module, and b) conflicts with the target path of QtQuick Controls 1. [ChangeLog][QtQml] Made the QML Engine capable of locating QML sub- modules from within a versioned parent module path. For example, QtQml.Models 2.x can be either in QT_INSTALL_QML/QtQml/Models.2 or in QT_INSTALL_QML/QtQml.2/Models. Change-Id: I2fe4bbdd6d04dd1e80cbe9b3e7e02617658a0756 Task-number: QTBUG-52556 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* qml: preserve composite singleton types.Marco Benelli2015-12-171-0/+2
| | | | | | | | Composite singleton types used to always have version -1,-1; regardless of what is written in qmldir. Change-Id: Ia193e73695e57095f6a09b97768805f2f23cd56a Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Allow importing protected modules with different major versionsJ-P Nurmi2015-01-081-3/+3
| | | | | | | | This allows QtQuick.Controls 1.x and 2.x imports to co-exist even if they are two different plugins with the same module directive. Change-Id: Idee302439e3c2fd6813ba2f41b69144fbae7902c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add new property "designersupported" to qmldirTim Jenssen2014-08-281-0/+2
| | | | | | | | | | | | | | | | | This patch adds a property called "designersupported" to qmldir. This allows the Qt Quick Designer to only load plugins that have the line ""designersupported"" in their qmldir file. So the designer can load sub components without risking to load plugins that have never been tested in the designer and that might crash. The check for "designersupported"" is activated by using QQmlImports::setDesignerSupportRequired(). Change-Id: I4bf07cc163faa47996eacb1365a7961c51c51060 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Extend the QML bootstrap library by the IR buildersSimon Hausmann2014-04-231-0/+1
| | | | | | | | | | | | | This is among other things needed to fix the qml import scanner to detect dependencies from .js files correctly. The patch also fixes the use of Q_QML_EXPORT towards Q_QML_PRIVATE_EXPORT where appropriate and corrects the wrong include path for the double conversion code to actually be relative to the file it is included from. This worked by accident because of other include paths present in the build. Change-Id: I338583dad2f76300819af8ab0dae8e5724c84430 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup: Remove last traces of QQmlScriptSimon Hausmann2014-03-191-1/+0
| | | | | | | | | | What remains is the code for removing .pragma from script source code (and replacing it with white-space to preserve line/column numbers). The previous code even returned the value of the pragmas, but for the remaining caller sites that value isn't used, so we can just return void. Change-Id: I16db15da236970660b817d6c4493005365a7a1af Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QmldirCache object leakLiang Jian2014-03-141-0/+1
| | | | | | | Delete all the QmldirCache objects in the linked list Change-Id: I9948ccce3d72aaed4f8b14b131e040177d7a15ef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Static plugins: support loading static plugins from several enginesRichard Moe Gustavsen2014-03-131-3/+5
| | | | | | | | | | | | | When loading dynamic plugins, we register them as loaded so that we don't try to register their types several times if using several engines. The same was not done for static plugins. This patch will ensure that we follow the same logic also for static plugins. Task-number: QTBUG-36532 Change-Id: Icc1e089ae5d682c38b2d36bf4808f1c753c122a4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Support statically linked module pluginsRichard Moe Gustavsen2013-10-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Up til now, QQmlImports would always assume module plugins are dynamically linked, and as such, go looking for them on the file system. This would fail for plugins linked in statically. This patch will hook into QQmlImports at the place where it iterates through all plugins in a qmldir and try to load them dynamically. If some plugins cannot be resolved, we now do an extra interation over static plugins to check if any of them has the correct uri specified in their metadata. Hooking into the loading process this late, will ensure that as much code as possible is shared between dynamic and static plugin loading so that setting up base urls, namespaces and guards will remain the same. Note: this patch is one out of several patches that is needed to build QML2 apps statically, and depends on plugins reporting their URI through the plugin meta data system. This will be injected automatically by qmake+moc. Task-number: QTBUG-28357 Change-Id: If9a204e942ca7003448e188a1a47eec69b34c37b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>