aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Allow import static plugins even when library feature is disabledKimmo Ollila2017-03-031-34/+5
| | | | | | | Removing QT_CONFIG(library) checks around static plugin handling code Change-Id: I5408d0fee2f58b27372c59004351f37ee8f566b9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlImportDatabase: Fix static build with clangRobert Loehning2017-01-311-0/+2
| | | | | Change-Id: I73895a1938c60a9d83f7e8bbe306eb0c3f05a5ed Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Enable resolution of composite types in QQmlTypeNameCacheRobin Burchell2017-01-271-4/+6
| | | | | | | | | | | | | | | | | | | | | We didn't have resolution of composite types previously, which is a prerequisite to do more exciting things with QML types in JavaScript (such as instanceof). By deferring the resolution to QQmlImports, we can avoid the need to fill the cache with types that may not be needed, while still finding types which are requested. In the future, we could consider removing the "special" handling for composite singletons as they should be found through QQmlImports now. If we do that, we may still want to cache the QUrl for the types, to avoid using QQmlImports too often directly, as it is a little slow itself. This change doesn't regress tst_compilation. Task-number: QTBUG-24799 Change-Id: I9ba2e4829ca49008fd180fb488c586475cf90674 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlImport: Decouple QQmlImportNamespace & Import type from qqmlimport.cppRobin Burchell2017-01-261-69/+34
| | | | | | | | | 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>
* Un-nest QQmlTypeLoader::QmldirContentRobin Burchell2017-01-261-11/+11
| | | | | | | | | This is mandatory to split some of QQmlImport's internal classes out into headers for reuse elsewhere, as we cannot forward-declare a nested class. Change-Id: I6524a372a89b37a22a99ed3eada76036e10e8660 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlImport: Document some methods used by QQmlTypeLoaderRobin Burchell2017-01-261-0/+16
| | | | | Change-Id: Ibe21938e83571e78d1baaca4c1f4b26563ab2f3a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlImport: Document populateCache methodRobin Burchell2017-01-261-0/+11
| | | | | Change-Id: Ibf559814d3d86b23c12a194fa619c207790e1e1d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Slight improvements to resolveType for the common caseRobin Burchell2017-01-251-9/+13
| | | | | | | | | | Only resolveLocalUrl if we really have to. The string manipulation are quite expensive. This boosts tst_compilation::bigimport a tiny bit. Change-Id: I435633c8be9fcf4f8166900e8c0a52b320fb64d3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlImport: Add a little documentation for QQmlImportNamespace & ImportRobin Burchell2017-01-251-7/+39
| | | | | Change-Id: Iee1dc32a5921b5da6d1511f26e93998baaae918e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlImport: Clean up & rename getTypeForUrl to fetchOrCreateTypeForUrlRobin Burchell2017-01-251-34/+66
| | | | | | | | | The new name better matches what the method does. At the same time, clean it up a little: make the flow a little clearer, extrapolate on some comments, remove some old debug. Also add a small method doc explaining this method does. Change-Id: I494efc2dfe8760734f228a9af440abf7067354b7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-7/+7
| | | | | | | | | | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlImportsPrivate: remove homebrew 'greaterThan'Anton Kudryavtsev2016-10-271-5/+2
| | | | | | | | | | | | | | Use std::greater Change-Id: I30554cd85b05e8c6ce13402d4b318751315cd0e6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-211-15/+18
|\| | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4isel_moth_p.h Change-Id: I8e86a649d1ef8ad27dc66cc8c290093b2faabc69
| * QML: Cleanup prefix/suffixes for plug-in resolvingErik Verbruggen2016-09-191-15/+18
| | | | | | | | | | | | | | So now we can read it without getting cross-eyed. Change-Id: Ica6a072fcd505fd4fedca3ccfac7dfc00b522354 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Qml: replace 'foreach' with 'range for'Anton Kudryavtsev2016-09-201-13/+13
| | | | | | | | | | | | | | Not all, just instances with low risk. Change-Id: Ie6b4530f748e04ccb90e7ef23415a91d6c377417 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QQmlImportNamespace: mark findImport() method as constAnton Kudryavtsev2016-09-171-7/+6
| | | | | | | | | | | | | | | | | | This method does not modify the object. While touching the code, port loop to C++11 'range for', and replace 0 with nullptr Change-Id: I3695f3aa162daf0da396a0991d96ac4c438c1221 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QmlImports: Extract Method makePlugins()Anton Kudryavtsev2016-09-161-10/+16
|/ | | | | | | This way we can keep the vector of plugins const. Change-Id: Icb5e8b6f461586aecb389144603aa4f0734c304b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-191-1/+1
|\ | | | | | | Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-181-1/+1
| |\ | | | | | | | | | Change-Id: I20c622263f40c322954328e4d10a8071db3ca6d1
| | * Doc: Change instances of 'OS X' to 'macOS'Topi Reinio2016-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change all occurrences where the Mac platform is discussed to use the macro \macos (defined in the documentation configuration in qtbase). Change-Id: Iea114ac73c01d74401bcd77373b41a825d2636c9 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Qml: optimize string usageAnton Kudryavtsev2016-08-091-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QStringBuilder more. Use QString::asprintf instead of arg()'s chain. Use += operator to reserve extra capacity for possible free following append/prepend/+= call. Change-Id: Ib65398b91566994339d2c4bbfaf94e49806b7471 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | QQmlImports: optimize excludeBaseUrlAnton Kudryavtsev2016-08-091-3/+1
| | | | | | | | | | | | | | | | | | | | | Don't allocate memory. Change-Id: I50542bd77c9b5432d452fec2a87b6858b5c4f9c7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Qml: replace QStringLiteral with QL1SAnton Kudryavtsev2016-07-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... or with QL1C in such cases: - if there is overloaded function - in QStringBuilder expressions Saves ~1.5 KB in text size. Build config: ubuntu 16.04 x64, gcc 5.3 Change-Id: Icc0789f1c244ce20a3182494b0c7f35c9d77e41d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devSimon Hausmann2016-05-181-10/+31
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/v8/qqmlbuiltinfunctions_p.h tests/auto/qml/qqmlqt/tst_qqmlqt.cpp Change-Id: I9dd93732f4b19513576ca1dd89ae18c69de0203b
| * | Teach the QML engine to find static Qt Quick Controls 2 stylesJ-P Nurmi2016-05-111-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The styles are installed to eg. qml/QtQuick/Controls.2/Material. That is, the version is in the parent module. See 3c5e438 for more details. Change-Id: Icdeccb356554ada74dd1116b99be198565c98de6 Task-number: QTBUG-53284 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | | Re-apply the cast part of commit 392c7b99348e2a96ef11adb5712095fbd13fb780Simon Hausmann2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We reverted this in 6f59c91c51edd7207635c3fa2f0b2b1179e7aa6e to avoid further breakage in a patch release. Now let's do the right thing in the next minor release and replace the qobject_cast on the instance with the IID check that won't require instantiating the plugin in the qml loader thread. [ChangeLog][QtQml][Important Behavior Changes] When the engine looks for QML modules / extension plugins in statically linked applications, the plugins are not instantiated in the qml loader thread anymore. For this to work however it is necessary for plugins to use Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) in their class declaration instead of hardcoding the interface id as a string literal. Task-number: QTBUG-52012 Change-Id: I45fe8b9fec23b3d0408b7ee79ce297c7d47ce36d Reviewed-by: Sebastian Lösch <Sebastian.Loesch@governikus.com> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | | Avoid QHash::values()Frank Meerkoetter2016-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Doing so will spare us from creating a temporary container just to iterate over it. Change-Id: Iab6aec0d83bfc168f12d2348909b053dfddf67a1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-131-39/+73
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsapi/qjsengine.cpp src/qml/qml/qqmlengine_p.h src/quick/items/qquickanchors.cpp src/quick/items/qquickanimatedimage_p_p.h src/quick/items/qquickitem_p.h tests/auto/qml/qqmlecmascript/testtypes.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tests/benchmarks/qml/creation/tst_creation.cpp Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
| * | Merge remote-tracking branch 'origin/5.6.1' into 5.7Simon Hausmann2016-05-091-1/+1
| |\| | | | | | | | | | Change-Id: I6648a0ce49e0fd2b0881444bd38b9a10c093dc18
| | * Revert parts of 392c7b99348e2a96ef11adb5712095fbd13fb780Simon Hausmann2016-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert the plugin loading check for Qt 5.6.x. It turns out that making this check strict broke multiple static plugin builds beyond the qtdeclarative repository. Let's not cause unnecessary breakage in a patch release of Qt to fix a bug that has existed for much longer. I'll revert this change in the dev branch for Qt 5.8, together with an entry in the change log to inform the developers that a behavioral change in their code is necessary (the use of the interface id variable). Change-Id: I3c658433eaa125ac0d272806e3bbbf016cf6d3cb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickimagebase.cpp src/imports/layouts/plugin.cpp Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
| | * Instantiate static Qml plugins declaring QQmlExtensionInterface onlySebastian Lösch2016-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When instantiating static plugins no check is done whether the QQmlExtensionInterface is declared. Therefore all user plugins are instantiated in the Qml thread, which may cause problems. Task-number: QTBUG-52012 Change-Id: Ia91ec5ec7b2a9721bd11e3648cdc161855b4454e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | Use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-261-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. While touching the code, also port loops to C++11 style. Change-Id: I04c99b24ea6afd3715e3edf9ea00bfab838fd53c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * | Allow target path version in a parent moduleJ-P Nurmi2016-04-211-32/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Scrape off a few allocations by using the QStringBuilderFrank Meerkoetter2016-05-091-4/+1
|/ / | | | | | | | | Change-Id: I7689fabb5398c2c2d2781b2c788dcc60f4e1ea44 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QQmlImportDatabase: Introduce utility message function.Friedemann Kleint2016-03-251-5/+7
| | | | | | | | | | | | | | Reduces the number of messages that need to be translated. Change-Id: I986d3202ac2dcc6c8e197e19c735dd66dad37f39 Reviewed-by: Shawn Rutledge <shawn.rutledge@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>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-181-6/+13
|\| | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I9588a3e2c7d590e031dd4c66905a79f0d74d3ac8
| * qml: preserve composite singleton types.Marco Benelli2015-12-171-6/+13
| | | | | | | | | | | | | | | | 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>
* | Rearrange the import paths so the qrc one is after the application pathAndy Shaw2015-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | By moving the qrc import path to be after the application one we ensure that when the application starts up it will look for the imports in the same way as it would both on deployment and development machine. This is particularly important when building Qt statically because it should be looking for the imports inside the resources. Change-Id: I81f1b7e96c0f9df3671249668accad7adfd00df4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Utilize the resources when building statically.Andy Shaw2015-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is needed so that the qmldir file is picked up correctly when using a static build of the plugins in the application as this gets taken care of automatically by qmake. The Q_INIT_RESOURCES line itself is only needed statically because no resource file is needed for dynamic libraries so it is protected with the QT_STATIC define. Task-number: QTBUG-35754 Change-Id: I9059e10c0846548f365fe4f95dd9c6100eeb43cd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-031-2/+2
|\| | | | | | | | | | | | | Conflicts: tools/qmlprofiler/qmlprofilerclient.cpp Change-Id: I1de8832fefd0e45fea16ca072b6c7ae44fa376d4
| * QML: Sanitize reading environment variables.Friedemann Kleint2015-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Change-Id: Ia8b7534e6f5165bd8a6b4e63ccc139c42dd03056 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-251-30/+3
|\| | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmldebug.cpp Change-Id: I93de5a81b18cdece475870cf7cfba1b9baef2304
| * Cleanup: remove HP-UX and AIX specific code pathsLars Knoll2015-09-221-30/+3
| | | | | | | | | | Change-Id: Iaa0ad08fd849f604bf12a17b19a3757b5ba4f72c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Return an error if QQmlImportsPrivate::importExtension() fails.Ulf Hermann2015-09-151-3/+11
|/ | | | | | | | QQmlTypeData expects an error to be returned if loading fails and will crash if the list of errors is empty. Change-Id: Idb6dbe35a2ce5f0629be45cc3fd582bbc25bc622 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>