aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Split CompiledData::CompilationUnit in twoUlf Hermann2019-05-161-3/+3
| | | | | | | | We need a CompilationUnit that only holds the data needed for compilation and another one that is executable by the runtime. Change-Id: I704d859ba028576a18460f5e3a59f210f64535d3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-161-5/+3
|\ | | | | | | Change-Id: I192cb06f3b92869699cb3e072f2c6c1e8dbb1ef4
| * Fix illegal downcast on QQmlEngine destructionAllan Sandfeld Jensen2019-05-141-5/+3
| | | | | | | | | | | | | | | | Make QQmlEnginePrivate::isEngineThread() legal to call during QQmlEngine destruction. Change-Id: I2bae9d70883cf8013f39f2046ebe83bb8dbcd46b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove last traces of QV8EngineUlf Hermann2019-05-081-10/+0
| | | | | | | | | | Change-Id: I59f738402d51e39188bbbca2ef1fbc8a61612372 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Move workerscript to its own moduleUlf Hermann2019-05-061-3/+1
| | | | | | | | | | Change-Id: I778cfe842ddf1c600a837d8f2061a338887eed95 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Move creation and management of singletons to QQmlEnginePrivateRichard Weickelt2019-04-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Singleton object instances were previously managed by QQmlType::SingletonInstanceInfo and kept in a shared storage. This caused concurrency problems when instantiating singleton instances from different QML engines in different threads. This patch moves the singleton house-keeping infrastructure to QQmlEnginePrivate and makes SingletonInstanceInfo immutable. Singleton objects are stored in a QHash with QQmlType as the key because the qml type id might be 0 for composite singletons. The public API of QQmlType is extended to provide more information about singleton types so that access to SingletonInstanceInfo is not needed. All internal accesses of singleton objects must now take the same code path via QQmlEnginePrivate::singletonInstance<T>() which simplifies overall usage of singletons and scatters less implementation details throughout the code base. Task-number: QTBUG-75007 Change-Id: I13c5fd21cac2eb7291f2cbcf2c2b504f0f51a07c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Clean up type registrationUlf Hermann2019-04-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QML-specific types need to be registered only for "QtQml". Make sure we don't accidentally add new QML-specific types to QtQuick. We also don't want the base types to be registered under any random URI and version. Formally qmlRegisterBaseTypes() is a public function, but it _really_ should not be called by anyone. Finally, split the types into ones that should belong to QtQml.Models and ones that belong to QtQml proper. Add a plugin that handles QtQml itself rather than using the QQmlEngine ctor for this. [ChangeLog] The accidentally exported function qmlRegisterBaseTypes() was removed. Change-Id: I8bf9f8515e18b016750c721fe694d4cda076780b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-251-1/+1
|\| | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp Change-Id: I517c001ea4eb0fdd8e469f9fffe5b7559a5b0795
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-221-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: If3bf1abc23a59c458be0bb862d92f2edcb16b79f
| | * QML: Pass type minor version when creating property dataUlf Hermann2019-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the type minor version recursive properties should be available or not. Check for that when resolving grouped properties. Fixes: QTBUG-33179 Change-Id: Id8f62befdc4a29d879710499e19d3d289bd18775 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QML: Split propertyCache into multiple filesUlf Hermann2019-02-011-1/+1
|/ / | | | | | | | | | | | | I want to be able to read the code. Change-Id: I063143ff63b0a476d783c892e1d328e7f5133fab Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* / Make QQmlDirParser and QQmlError available in QmlDevToolsUlf Hermann2018-10-251-1/+1
|/ | | | | | | | We will need them for the QML language server. Also, always build all of QQmlDirParser. The QT_CREATOR condition is mostly useless. Change-Id: I476864b55f6ff3953c11e7887525a043a9405e00 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add qml-worker-script featureMorten Johan Sørvig2018-09-121-1/+1
| | | | | | | | | Depends on features.thread. Change-Id: I65db68ac90c15af0ac0571ee021122f7ca2ca051 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make QtDeclarative work for the no-thread configMorten Johan Sørvig2018-09-051-0/+2
| | | | | | | | | | | | | Force use of the basic render loop, adapt qqmlthread and qqmltypeloader to work on a single thread. Disable components and features that require worker threads: qmldb_server, worker script, shapes, folderlistmodel, threaded render loop, software renderer. Done-with: Lorn Potter <lorn.potter@gmail.com> Change-Id: I77d965947f684f8b7d19284b5decd893395316cb Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Add support for importing ES modules in .qml filesSimon Hausmann2018-08-171-0/+2
| | | | | | | | | | | | | | | | | This is a straight-forward hook into the module implementation in QV4::ExecutionEngine. Modules are pre-compiled in the QML type loader thread. That thread keeps track of all pending loading scripts through the type loader's m_scriptCache. Once a module is compiled, it's thread-safely registered with the execution engine. Script instantiation and evaluation is done solely in the QQmlEngine's thread. ES Modules are identified in imports as well as qmldir files by the .mjs extension. Change-Id: Ie9c59785118afcb49f43a1e176a9f7db00f09428 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash when QML engine warning handler feeds errors back into QMLSimon Hausmann2018-04-091-2/+0
| | | | | | | | | | | | | | When a QQmlEngine warning handler that's called during component instantiation results in subsequent component instantiations, either via the signal or via a Qt message handler like in the bug report, then we might end up modifying the linked list of errored bindings before returning from the QQmlEnginePrivate::warning() call. The easy fix is to extract the QQmlError, unlink the delayed error from the linked list and then deliver the error to the QQmlEngine. Change-Id: I6b7be61b57b35636282595937046ff76091144a3 Task-number: QTBUG-53293 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* use the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-271-2/+2
| | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-5/+5
| | | | | | | | | | | | | 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>
* Remove double indirection between QJSEngine and QV4::ExecutionEngineUlf Hermann2018-02-021-8/+6
| | | | | | | | As QJSEngine's handle() method is internal, we can redefine it to return a pointer to an ExecutionEngine. That makes many things easier. Change-Id: Ie3df99e0bad5f00ad4fe73182896cd135fa82994 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow exported signal handlers for signals with revisionThomas Hartmann2018-01-121-1/+1
| | | | | | | | | | | | | | | Properties of QML objects or alias properties to QML objects have to know about the revision of the QML type. If the property is used as a grouped property and a signal or property is assigned. Without this patch this is not working with signals that have a revision. To get this working we store the minor version of the QML type in QQmlPropertyData and retrieve the QQmlPropertyCache with the correct AllowedRevisionCache using this minor version. Task-number: QTCREATORBUG-18820 Change-Id: I1e20169e0d5a2ae11059a951aa83a5c94106accb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make qml-debug a proper featureUlf Hermann2017-11-081-1/+1
| | | | | Change-Id: Iea33ff0200f0bbf43953fedba030edf91d0f1417 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix memory corruption with type trimmingSimon Hausmann2017-08-231-3/+3
| | | | | | | | | | | | | | | | | | When creating a composite type, we register the meta-type in the qml loader thread. However we would require linking of the compilation unit to the QML/engine thread before we would be able to also undo that registration in unlink(), because we require the engine member to be set. If that did not happen, i.e. a qml type was loaded and trimmed from the cache before it was ever linked, we would end up with a dangling pointer in m_compositeTypes. Let's handle the case of CompilationUnit referring to a QML composite type separately from it being a compilation unit resulting from a .js file or in a plain QJSEngine environment. Task-number: QTBUG-62630 Change-Id: Ia68cc46f05345702bd9ba0378f61118f1964d141 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the m_qmlLists member in the QML engine to QQmlMetaTypeLars Knoll2017-08-021-1/+0
| | | | | | | | | | This is a pure metatype id to metatype id mapping, nothing in there is specific to a QML engine instance. Thus move the mapping to QQmlMetaType and make it global for all engines. Task-number: QTBUG-61536 Change-Id: I3792567bc9f585e3e0fbbad94efd1ec3a0db3de0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove QQmlEnginePrivate::typePropertyCacheSimon Hausmann2017-08-021-7/+1
| | | | | | | | | Instead of maintaining a hash per QQmlType and minor version, move the version specific property caches into QQmlType. Task-number: QTBUG-61536 Change-Id: I72f3990cb93e64ac5074060b4ff327043eab7966 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QQmlType by valueLars Knoll2017-08-021-7/+7
| | | | | | | | | | | 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 QQmlEngine::offlineStorageDatabaseFilePath(db), use in LocalStorageShawn Rutledge2017-02-021-0/+1
| | | | | | | | | | | This is C++ API to get the actual storage path for a particular database. [ChangeLog][QtQml] Added QQmlEngine::offlineStorageDatabaseFilePath(dbName) to allow getting the actual storage path for a particular database. Task-number: QTBUG-52013 Change-Id: I1cbd9454c537f08c97f4dafc06fd6b14e81c51af Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Turn the no-network support into a configurable featureLars Knoll2016-10-101-1/+1
| | | | | | Change-Id: Ic70f60c124fe166b37fbe9b853735be3c5e0d46d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Qt object: Add exit(int)Cavit Sina Dogru2016-08-091-0/+1
| | | | | | | | | | | | This is similar to the Qt.quit() function but also specifies the return code that the event loop will return. [ChangeLog][QtQml] Added exit(int retCode) method to the Qt global object. An application can call Qt.exit to specify a return code of the engine. Task-number: QTBUG-54360 Change-Id: Iaa319e6dc4d6b99dc3a5c01845e87b936fd2cab0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove some unused members on -no-qml-debugUlf Hermann2016-07-281-0/+5
| | | | | | | | It's debatable if the uglification is worth the overhead of a few pointers. Change-Id: I63b55b2043b8752a94d4b862c3892915135a72b7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Qml: Create profiler adapters in the pluginsUlf Hermann2016-07-281-1/+0
| | | | | | | This way QtQml doesn't need to know the ctors. Change-Id: Ie74049092b5eb9837537591c0cf37ad1487e4066 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove QQmlCompiledData in favor of QV4::CompiledData::CompilationUnitSimon Hausmann2016-06-011-2/+2
| | | | | | | | | 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>
* Moved meta-type id members to QV4::CompiledData::CompilationUnitSimon Hausmann2016-05-311-1/+1
| | | | | Change-Id: I808d0a36094e873b69cf24a5b0113e741ff2a25d Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-131-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * V4: make QQmlEnginePrivate::dereferenceScarceResources inlinable.Erik Verbruggen2016-05-041-0/+22
| | | | | | | | | | | | | | | | Done by giving the "expensive" part its own function, that's even unlikely to be called anyway. Change-Id: I35621fb0a764879f9339b9e23f210c66971ff5b7 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | V4: make QQmlEnginePrivate::dereferenceScarceResources inlinable.Erik Verbruggen2016-04-211-0/+22
| | | | | | | | | | | | | | | | Done by giving the "expensive" part its own function, that's even unlikely to be called anyway. Change-Id: I35621fb0a764879f9339b9e23f210c66971ff5b7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.7' into devSimon Hausmann2016-04-081-0/+10
|\| | | | | | | Change-Id: I60b8a701b6d90f8572143cf760873f6b8b453c14
| * QML: allow more methods to get inlined.Erik Verbruggen2016-04-051-0/+10
| | | | | | | | | | | | | | | | Most of these methods are small, and all of them lie in the 'hot path' for simple bindings like 'width: parent.width'. Change-Id: I0071cec92b49437a352160b0283ed6c89a278a07 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.7' into devAndy Nichols2016-04-051-1/+1
|\| | | | | | | Change-Id: I57b06e2e98beb010a56dd0593d93e078ecf76eea
| * V4: Allow some more functions to be inlined.Erik Verbruggen2016-03-311-1/+1
| | | | | | | | | | Change-Id: If9d1f87fd7cf0b12d2827c4574109234be7e8ab8 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | QtLite: no_network option for QtDeclarativePaolo Angelelli2016-03-041-2/+2
|/ | | | | | | | | | | | This patch adds the support for a no_network option for QtDeclarative, and the necessary #ifndef all around the code. no_network changes the interface of some classes, therefore using it breaks source compatibility. Change-Id: Iff612fb07041b8a7db99bd595bf038efaac2dd8a Reviewed-by: Risto Avila <risto.avila@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-191-2/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitem.cpp tests/auto/quick/qquickgridview/tst_qquickgridview.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I3cf47faa2fe567d62fffd985aeecbefe5811cc42
| * Revert "Fix crash on QQmlEngine destruction."Robin Burchell2016-02-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2e75be5f64fb21cbbdff3353dbd507c2ca26946a. This patch was originally written by Andrew den Exter in 222e06bf4ed509e72c1533cbe1d4859ca96933f3, externally from the main Qt tree. I upstreamed this as part of our porting efforts. Some time later, this was accidentally reverted in 2e75be5f64fb21cbbdff3353dbd507c2ca26946a: we can't go back in time to examine exactly what happened, but presumably Andrew didn't notice that I had upstreamed this, attempted to apply the patch and ignored the "already applied" warning by accident - and continued on dutifully with the patch accidentally reverted. This change is correct, though, and is thus reinstated. Change-Id: Idfe6ab39ad011f0401de25fe056aa3eb3fb8b424 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au> 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>
* | Remove debugChangesHash from QQmlEngineUlf Hermann2016-01-121-17/+0
|/ | | | | | | Since the inspector doesn't use it anymore we can drop it. Change-Id: I9c4ffc3988bcd9937a4a473d5de287c7a5eda13e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Retrieve services from debug connector, not via static instance()Ulf Hermann2015-08-041-1/+0
| | | | | | | | | This will allow us to remove the instance() methods and create the services from factories in plugins. Also, it allows us to remove the isDebugging member from QQmlEnginePrivate. Change-Id: Id9d9820a910902ecfdb1e8175e215093ce3d0965 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Simplify property capturing codeLars Knoll2015-06-181-22/+2
| | | | | | | | | No need to inherit from a base class defined in QQmlEnginePrivate. The capture handling can be a simple value based class without virtual methods that is allocated on the stack. Change-Id: Ib0ddf4afcaf154b3f953d8c9322f5bec196d7abf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make bindings refcountedLars Knoll2015-06-101-1/+0
| | | | | | | | | | | Refcounting our bindings greatly simplifies our memory management of the objects and ensures we safely clean them all up. In addition, it allows us to remove the m_mePtr and weak reference handling from QQmlAbstractBinding as we can safely handle this through the same mechanism. Change-Id: If23ebc8be276096146952b0008b62018f5d57faf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove more unused code from the QQmlEnginePrivateHolger Hans Peter Freyther2015-06-081-4/+4
| | | | | | | | | | | | overloadError has always been false and the if (overloadError) was dead code. The code has been commented out for a long time and I started to extend the #ifdef. The QQmlError is only used inside the commented out code so I have removed the error param. This is fixing Coverity CID 10612. Change-Id: I48f36ede6ba615a34b15caefb0eea5d7e898f120 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Make QQmlPropertyCache available in QJSEngineSimon Hausmann2014-12-291-107/+1
| | | | | | | | | The QQmlEngine has two containers for property caches, one for QML types and one for all-purpose meta-objects. The latter is rather useful and now being moved to QJSEngine to be available there. Change-Id: Ieab65c400b8a2e410e5f9eee6d603162dbb864d9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>