aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontext_p.h
Commit message (Collapse)AuthorAgeFilesLines
* headers: Add missing override and remove redundant virtualAlexander Volkov2016-12-071-1/+1
| | | | | | Change-Id: Ifa816ebcd79372afca42dbd0dc0ecde006bb688a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Qml, Imports: mark some methods as constAnton Kudryavtsev2016-10-131-2/+2
| | | | | | | These methods do not modify objects. Change-Id: I67b1a10cfd0b32688500fca3265a96f53afd1b57 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Minor refcounting cleaningSimon Hausmann2016-06-031-1/+1
| | | | | | | | Replace manual reference counting with automated counting, which is less error prone. Change-Id: I6a133bf9610f0d789f745b3cc1f0016e670a9525 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Optimize named object handlingSimon Hausmann2016-05-261-3/+8
| | | | | | | | | | | | | | | | By storing the object indices of named objects in the CompiledData::Object of a component, we can achieve two things: (1) We can eliminate the hash of vectors in QQmlCompiledData for the object-to-id mapping (2) We can store the mapping from object name to integer object id in the CompilationUnit and share it across different QQmlContextData instances (as long as it is not modified). Also added a new test that verifies the functionality of a .qml file starting with Component{} itself with object names, something that was previously only implicitly tested through some of the examples (corkboards.qml for example). Change-Id: I28c70217222dc0e5252bf5247b7e3fc4def47446 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Simplify object to id-in-context mappingSimon Hausmann2016-05-261-2/+2
| | | | | | | | | By storing the calculated integer id for an id-named object in CompiledData::Object we can simplify the code and replace a hash table with a plain vector. Change-Id: I4a84cdd00e98766d603d152e5a6574b232771a02 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* V4: Allow some more functions to be inlined.Erik Verbruggen2016-03-311-0/+1
| | | | | Change-Id: If9d1f87fd7cf0b12d2827c4574109234be7e8ab8 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* 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>
* Get rid of QQmlAbstractExpressionLars Knoll2015-04-241-3/+3
| | | | | | | | | The class is always used together with QQmlJavaScriptExpression, so we can just as well fold the functionality together into one class and simplify our code. Change-Id: I23820e51efaaea16ae5db7e2153a827d7b22999e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Speed up composite type instantiation with lots of IDsSimon Hausmann2015-04-161-10/+2
| | | | | | | | We don't need to convert from a QHash to a QVector in order to populate the property name cache in QQmlContextData. Change-Id: Ifa8e4f64a1e174907e92684b2d38abaf0a4a705c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Speed up object creationSimon Hausmann2015-04-161-3/+5
| | | | | | | | Avoid copying url and file name twice into the context every time we instantiate an object. Change-Id: I1c76b80b9c44f95512af5899d760151f6dcd7bb5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Speed up object creation with lots of id name objectsSimon Hausmann2015-04-161-9/+11
| | | | | | | | | | | In the common case when objects are referenced by id, we don't need the QQmlContextData's property name cache for the lookup. Instead of bindings we resolve the id to an integer at type compilation time. Therefore we can delay the population of the QQmlContextData's propertyNames until we need it and therefore safe time on startup. Change-Id: I2e8eeb51b1ac92f230059be3467f9a1e00fdbbef Reviewed-by: Lars Knoll <lars.knoll@digia.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>
* Fix QQmlExpression/QQmlScriptString/QQmlBinding crashesSimon Hausmann2014-10-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | In the QQmlScriptString we store the binding id and it is an index into the runtimeFunctions array of the compilation unit. However we don't store the compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve it from the cache via the context url (we have the context after all). That turns out to be not a reliable way, as sometimes the URL might slightly differ from the originally compiled cache (qrc:/// turning to qrc:/ maybe). Consequently the type is (unnecessarily) compiled again and unfortunately not _linked_, therefore the runtime functions array is empty. Another option is that when the component was created from a QByteArray, then no entry exists in the cache in the first place. This patch addresses the problem by storing a reference to the compilation unit in the QQmlContextData. That we can safely retrieve and it'll make sure the compilation unit also stays alive. In the process of that the manual reference counting was switched over to QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit. Task-number: QTBUG-41193 Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7 Reviewed-by: Lars Knoll <lars.knoll@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>
* Cleanupsv5.3.0-beta1Simon Hausmann2014-03-211-1/+0
| | | | | | | | | * Get rid of members in QQmlCompiledData that were used by the VME and are now unused * Get rid of QQmlVME friend declarations that are not needed anymore Change-Id: I11b4b6f0b4b0b60edf92a1256be3d0d44d76bbc9 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 whitespaceOswald Buddenhagen2014-01-221-1/+1
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Speed up lookups of imported scriptsSimon Hausmann2013-10-311-1/+1
| | | | | | | | | | The QQmlContextData stores the JS objects of imported scripts in a QList<PersistentValue>. Instead of indexing into that list, this patch changes ctxt->importedScripts to be a JavaScript array, that in the IR we can index via subscript. Change-Id: Ie2c35fb5294a20a0b7084bb51d19671a27195fec Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Replace us of v4 identifiers for object id mapping in qml compilerSimon Hausmann2013-07-021-1/+8
| | | | | | | | | | | | The compiler is executed in a separate thread, at which point it doesn't work very well to access the identifiers data structures of the engine on the main thread, allocate new strings and potentially also trigger GC. This patch moves the data into an intermediate QVector and constructs the identifier hash on the receiving end in QQmlContextData::setIdPropertyData. Change-Id: I676cf633cf1c55ee2e8f818e6963368ad55913cd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Convert IdentifierHash to be template basedLars Knoll2013-06-281-2/+2
| | | | | | | | | Make it a template based class, so we can store more then just integers here and replace more StringHash'es with it. Change-Id: I21442d13c6260f184bc7b63a8a58e826699f0c83 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of QQmlIntegerCacheLars Knoll2013-06-281-3/+3
| | | | | | | Replace by the new IdentifierIntHash. Change-Id: Ib210cd898a30ad3e2f9349387e1a74d92ed5f831 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove last traces of v8 API and v8 compatibility layerSimon Hausmann2013-06-121-2/+0
| | | | | | | | The debugger and profiler service remain as bigger parts that need to be ported properly to v4. Change-Id: I68e72d6db66fe497eb58ed60df417ffe4662d115 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove QV8Bindings classLars Knoll2013-05-241-3/+0
| | | | | | | | | This class tries to optimise binding compilation with v8. With the approach in v4 where we don't rewrite binding expressions anymore, this is not required anymore. Change-Id: I616aeeba85bc17a950d4c7341b3042ed8aa42bff Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove all references to the old v4 codeLars Knoll2013-05-231-7/+0
| | | | | | | | The old v4 files have already been removed, so cleanup all the #ifdef'ed code that still references them. Change-Id: Ifc5c59add5af36a61586a43b13291d7836cccd78 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more v8::Persistent usagesLars Knoll2013-05-071-1/+1
| | | | | Change-Id: Ifa1706e2e609ded86a8bc1a840ca2ed36b869098 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Disable the old v4 engine by defaultLars Knoll2013-04-201-0/+4
| | | | | | | | Left the code in there, as a reference for how we might want to build up binding evaluation in the new v4. Change-Id: I5c81ea986d642b524fb02087d819b39c4e3fb257 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove unnecessary exportsMatthew Vogt2012-05-181-1/+1
| | | | | | | | | Reduce library load time by removing any exports which are not required by existing clients. Task-number: QTBUG-24768 Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Better checking top level root object creation statusCharles Yin2012-05-091-1/+2
| | | | | | | | Add QQmlContextData::isRootObjectInCreation flag, only set it to true in Init qml instruction, once a root ojbect created, set it to false and set QQmlData::rootObjectInCreation to true. Change-Id: Iba7b348ab664a472280d8d7283e93787b3dd0a56 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Emit Component.onDestruction before context is invalidatedMatthew Vogt2012-05-041-1/+3
| | | | | | | | | | | | When a component no longer has any live references, emit the destruction signal immediately so that handlers are run before the associated V8 resources are invalidated. Also, when the root context of the engine is destroyed, emit the destruction signal before destroying any resources needed to process the resulting binding invocations. Change-Id: I722dd6e4b60c499b533fc45e33b61e95bca6187f Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix bitfield waste in QQmlContextDataMartin Jones2012-03-201-1/+1
| | | | | | | Why we do this at all, I have no idea. Change-Id: I35c78f4603499d5bb13d4608cc4f5eba0ee342ca Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+334
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>