aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmltypeloader
Commit message (Collapse)AuthorAgeFilesLines
* QQmlTypeLoader: Drain events before shutting down the threadUlf Hermann2017-10-203-0/+52
| | | | | | | | | | We take references to types when sending events to the other thread. If we don't process the events, the references are kept, which leads to memory leaks. Therefore, when shutting down a QML engine, we have to make sure the event queues are emptied. Change-Id: Id8b0440029cfd7d03a9e540747eaedbcaa7c9ff3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tell QQmlImportInstance::resolveType what kind of type we wantUlf Hermann2017-10-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-215-0/+54
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmltypeloader.cpp Change-Id: I07647700fc86764c95a5ef95c568e700a70fe45f
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-165-0/+54
| |\ | | | | | | | | | Change-Id: Ib45654e3e79087da4754377f0d78b70c44ed4695
| | * Allow for garbage collection of types with errors in trimCache()Michael Brasser2016-08-305-0/+54
| | | | | | | | | | | | | | | | | | | | | Change-Id: I821ea14f60871735bface4e2cf4e61fcb61b2784 Task-number: QTBUG-55567 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QML: Only release types if they aren't referenced anymoreUlf Hermann2016-06-101-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just checking for references on m_compiledData is not enough. The actual component can also be referenced. Thus it won't be deleted on release(), but cannot be found in the type cache anymore. Task-number: QTBUG-53761 Change-Id: I8567af8e75a078598e4fed31e4717134e1332278 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-211-3/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickflickable_p_p.h src/quick/items/qquickpathview_p_p.h tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp Change-Id: I77664a095d8a203e07a021c9d5953e02b8b99a1e
| * | QML: Only release types if they aren't referenced anymorev5.7.0Ulf Hermann2016-06-111-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just checking for references on m_compiledData is not enough. The actual component can also be referenced. Thus it won't be deleted on release(), but cannot be found in the type cache anymore. Task-number: QTBUG-53761 (cherry picked from commit 2ac19881f92c94f4e9427bd9ff513210675f259e) Change-Id: If254d5bca1f41ec948ec1438df0d37bf8d531bdf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Remove QQmlCompiledData in favor of QV4::CompiledData::CompilationUnitSimon Hausmann2016-06-011-2/+1
|/ / | | | | | | | | | | | | | | | | QQmlCompiledData used to contain the binary data for instantiating QML types in the QML VME. Nowadays the QML type compiler as well as the JavaScript compiler create a QV4::CompiledData::CompilationUnit. Change-Id: I155f62a5ecfb55a3fe230520231b6d8fd5b28ac9 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-273-1/+39
|\| | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickimagebase.cpp src/imports/layouts/plugin.cpp Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
| * Occasionally trim the type cacheUlf Hermann2016-04-192-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | As loaded components are kept in a cache, they are never removed by the garbage collector. So, if you periodically create new components, they leak. This change adds a floating threshold for the number of components. When that threshold is surpassed trimCache() is called and unneeded components are removed. Task-number: QTBUG-42055 Change-Id: I30e3e4ee287f6d34376713668009c67614a50e0c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Instantiate static Qml plugins declaring QQmlExtensionInterface onlySebastian Lösch2016-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* | Updated license headersJani Heikkinen2016-01-209-153/+108
| | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-032-0/+53
|\| | | | | | | | | | | | | Conflicts: tools/qmlprofiler/qmlprofilerclient.cpp Change-Id: I1de8832fefd0e45fea16ca072b6c7ae44fa376d4
| * Load component synchronously in method_createQmlObjectUlf Hermann2015-11-032-0/+53
| | | | | | | | | | | | | | | | | | | | | | setData() is not guaranteed to synchronously load the type. In fact, most of the time, it doesn't. However, by adding a private Synchronous mode to QQmlTypeLoader we can prefetch the type synchronously and then inject it into the component. Task-number: QTBUG-45418 Change-Id: I640f12ad20c01b778b5bc41f43574d8aea504195 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+0
| | | | | | | | | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: I699f2881e291cce02a6a608a8710638886e38daa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-031-1/+0
|/ | | | | Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-128-48/+48
| | | | | | | | | 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>
* Update license headers and add new licensesJani Heikkinen2014-08-258-144/+80
| | | | | | | | | - 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>
* Fix leak-on-exit of QSGRenderLoop::s_instanceAlex Montgomery2014-01-281-0/+1
| | | | | | | | | s_instance is created with new and never deleted which causes several destructors to never be called. Task-number: QTBUG-35731 Change-Id: Icccb19186958f8bb74c5fd2b4b41165255debc46 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Always call callCompleted in QQmlDataBlob::tryDoneAlbert Astals Cid2013-10-0212-0/+477
We need this since it could happen that in QQmlComponentPrivate::loadUrl we did QQmlTypeData *data = QQmlEnginePrivate::get(engine)->typeLoader.getType(url, loaderMode); and got a sync QQmlTypeData even if we asked for async, and thus the async loader was never notified when it finished and we were never loaded. Situation in which this can happen is: * ListView with an async Loader as delegate * Loader loads two items A and B, while A is a B * Item 0 of the ListView triggers an async loading of A that triggers the sync loading of B * Item 1 of the ListView triggers an async loading of B * Since B is already being loaded (though in sync), we just add ourselves to the people that want to be notified * sync loading of B is done and QQmlDataBlob::tryDone does not call the callbacks because it's sync * Item 1 is never finished loading Change-Id: I52a0979a1d3cfcfe73a71196bf24f491d6cf8e9a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>