aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* V4: Replace QVector with (Q)VarLengthArray in BasicBlock.Erik Verbruggen2016-01-062-7/+25
| | | | | | | | | This prevents extra mallocs in nearly all cases, because the number of incoming edges is not that big. The outgoing edge count has a maximum of two. Change-Id: I89195809952ce6087c5af51d717a4c2d8ac6b853 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix a couple of container detachmentsSérgio Martins2016-01-052-2/+2
| | | | | Change-Id: I0def20d858de7721771702907b7a431b5fb90a1f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QQmlXmlHttpRequest: Fix a memory leak on use of XMLHttpRequest's responseXML.Robin Burchell2016-01-051-0/+1
| | | | | | | | | | | | | | DocumentImpl (the root of all evil) inherits QQmlRefCount, thus, it has an initial refcount of 1. We correctly released the initial ref in the case of error, but if there is no error, we don't: we pass it over to v4 using class Node which (in Node::Node) increments the refcount again. When Node is later on collected by the GC, the document's refcount is never decreased past the initial ref, thus, not deleted. Task-number: QTBUG-50231 Change-Id: Icefe4391a785c95cb8900219be8ba71f9c53785f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix value changed logic for ValueTypeProvider typesFrank Meerkoetter2016-01-041-1/+1
| | | | | | | | | | | | | | | Fix broken value changed logic for types implemented through the ValueTypeProvider interface (QtQuick and Qt3d). It affects vector2d, vector3d, ... The signal was not emitted for the cases where the new value was equal to the default value of a given type. Also add a unit test to cover this area. Change-Id: I9491b0462c78fecc4c704ea36921611c1bd6b2ee Task-number: QTBUG-50204 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix crash in a non-debug build with assertions enabledThiago Macieira2015-12-291-12/+4
| | | | | | | | | | | | | | | | | | | | QV4::Heap::Base::setVtable has a Q_ASSERT on the state of Base::mm_data, but that member is never initialized anywhere (that is, the Base class does not properly protect its invariant). There were workarounds in some places for initializing the member, but only in debug mode. That was wrong for a number of reasons: 1) Q_ASSERT is still enabled if QT_FORCE_ASSERTS is defined 2) in release mode, the compiler will remove the double initialization anyway Another solution would be to give QV4::Heap::Base a constructor that initializes the member, but I am not sure whether adding a constructor to this class is permitted. Task-number: QTBUG-49681 Change-Id: Ic90fe6b1cbe84978a02fffff141beacbe73c0b9c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Revert "Fix QtSharedPointer::ExternalRefCountData object leaks"J-P Nurmi2015-12-236-27/+2
| | | | | | | | | | This reverts commit 839d2d3e2368bc8e107d22203b0611c852f54319, which has been causing crashes in qtquickcontrols2 auto tests and making it nearly impossible to integrate anything over the past few days. Change-Id: I570b286a067aae5e3c2d8c56ad601e1a6cb58c20 Task-number: QTBUG-50134 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4: Shrink IR::Temp by removing unnecessary padding.Erik Verbruggen2015-12-231-5/+5
| | | | | | | On 64bit systems, the size goes from 32 bytes to 24. Change-Id: Ic97f98b8f64fd5452f259e825a6bfd1656484fc5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix QtSharedPointer::ExternalRefCountData object leaksJian Liang2015-12-186-2/+27
| | | | | | | | | | | Call destroyObject() for every QV4::Heap::QObectWrapper object in heap in QV4::MemoryManager::sweep() to make sure the QPointer object contained in QV4::Heap::QObjectWrapper is properly destructed. We also keep track of QObjectWrapper in QV4::Heap::ModelObject to make sure we destory them in QV4::MemoryManager::sweep() Change-Id: I3b3e96cfc300c2e21ab691762879ac2970afa90c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* qml: preserve composite singleton types.Marco Benelli2015-12-173-8/+17
| | | | | | | | 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>
* Fix bogus warning when using Binding on value typesLars Knoll2015-11-271-26/+20
| | | | | | | | | In addition streamline the code and only do the lookup of the property name once. Change-Id: If2bad4b9179214492ff5692cf1f503f927ca2246 Task-number: QTBUG-48918 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Don't try to resolve id values or singleton member as propertiesLars Knoll2015-11-271-1/+2
| | | | | | | | | | | | Change 1a1f10806c901bc10483370a932d41af0c9629cd started mapping id values to member expressions in the IR. But these should of course not get resolved against local properties of the object. Change-Id: I56bef738ec60b818d7af86bb1aa6d37b2c01d3fd Task-number: QTBUG-49484 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Anton Kreuzkamp <anton.kreuzkamp@kdab.com>
* Make property interceptors work on alias properties againLars Knoll2015-11-266-114/+192
| | | | | | | | | | | | | | | | | | | Fixes a regression introduced by change 01c0c0963794f4dd8c3601e8340cc3dc4dec41bd, where interceptors wouldn't work correctly on alias properties. This required some refactoring and splitting out the interceptor handling from the VMEMO into it's own class, as we are now installing bindings directly on the target property of an alias and not on the alias anymore. We now resolve the target property inside the QML object creator and install a interceptor metaobject on the target if required where we can then register the interceptor. Change-Id: I3ebc8f492ce5dcab7acf901711b47336d5182ffa Task-number: QTBUG-49072 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix crash related to BoundFunctionsFrank Meerkoetter2015-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | This fix prevents the crash documented in QTBUG-49076. To quote Erik on the cause of the crash: Call stack is probably: FunctionPrototype::method_bind -> BoundFunction::create -> mm::allocObject -> BoundFunction::BoundFunction -> Heap::FunctionObject -> (Scoped)FunctionObject::init -> engine::newObject -> ... -> mm::allocObject The call to Heap::FunctionObject in BoundFunction is the call to the parent class constructor, which causes an allocation. But at that point, BoundFunction's target is still zero-initialised (the real initialization happens first thing *after* the parent class' constructor is called). Change-Id: If256f59168867cba9c886642ebaacb1d56801da4 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6Liang Qi2015-11-201-0/+3
|\
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-171-0/+3
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickimageprovider.cpp Change-Id: I7ca4e49468b5ba697208287be4684e42b9900023
| | * Don't normalize the path via the shell if it is a qrc based pathAndy Shaw2015-11-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing a qrc based path to shellNormalizeFileName() was causing problems with the Windows API. Since it won't change the path in this case anyway because the path is not valid on the file system then there is no need to do any checking. Task-number: QTBUG-46248 Change-Id: If20075c25aade3740287250b4e1f31538b398f8f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Doc: Added link to Extending QMLNico Vertriest2015-11-201-2/+1
|/ / | | | | | | | | | | Task-number: QTBUG-33521 Change-Id: I616369c3a535395ddb465a2f787dec7fc055a503 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Document default argument behavior of Qt.createComponent()Mitch Curtis2015-11-161-2/+15
| | | | | | | | | | | | | | | | | | It's not currently clear how to get the default mode when also passing a parent, though lots of Qt code simply omits the argument. Change-Id: I35db7cf57991a2a3fafe4d00df2879b98037e93c Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | Doc: added link to Qt5 Cadaques in external resourcesNico Vertriest2015-11-121-1/+6
| | | | | | | | | | | | Task-number: QTBUG-45921 Change-Id: If114e6bab5e69851a67bdda1588a428b31d7b691 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Introduce a more sane "default constructor" for Qt.matrix4x4()Sean Harmer2015-11-111-0/+5
| | | | | | | | | | | | | | | | | | | | If no arguments are specified, create an identity matrix. This is by far the most common use case. This change avoids having to type in the 16 arguments of the identity matrix. Change-Id: I9e0d71897c5368d19ae87cff936df4b9e5e9b84a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Load component synchronously in method_createQmlObjectUlf Hermann2015-11-033-68/+99
| | | | | | | | | | | | | | | | | | | | | | 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>
* | CMake: Make sure to export all pluginsKevin Funk2015-11-021-0/+5
| | | | | | | | | | | | | | | | | | | | Also export plugins ending on "Factory". CMake by default only picks up plugins which have a PLUGIN_CLASS_NAME ending on "Plugin" Task-number: QTBUG-43438 Change-Id: Ib954276dc0eee83f9d48bed0502a16df8194ce9b Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Stephen Kelly <steveire@gmail.com>
* | Doc: added required include statement QtQmlNico Vertriest2015-10-301-0/+4
| | | | | | | | | | | | Task-number: QTBUG-48172 Change-Id: I571a2a28856c95e4293c526aefc8e7ca8c88a0aa Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Doc: added spec on defining enums register.typesNico Vertriest2015-10-301-0/+1
| | | | | | | | | | | | Task-number: QTBUG-48050 Change-Id: Id737e89aa59885d22132bcde020ed04b509201ed Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Doc: corrected typo in doc basic typesNico Vertriest2015-10-301-1/+1
| | | | | | | | | | | | Task-number: QTWEBSITE-517 Change-Id: I5177d45f294566e9551e08755ef627008e86cd35 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Doc: fixed link issuesNico Vertriest2015-10-301-1/+1
| | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I9f989cd59780ab325cd3f8ddb824868763e369b3 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Remove uses of QT_POINTER_SIZE, replacing with proper constructsThiago Macieira2015-10-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | Where the size of void* was really wanted, use sizeof(void*). There's only one use of QT_POINTER_SIZE in qtdeclarative now, in fdegen/ main.cpp selecting the ELF size constants. It's easier to keep it like that than to use C++ selecting constructs. The tool isn't built anyway. Change-Id: I1d0f78915b5942aab07cffff140fa0f99ce7d7d4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Use the correct macro to detect 64-bit value encodingThiago Macieira2015-10-295-12/+12
| | | | | | | | | | | | | | We have a macro for it, so let's use it. Change-Id: I1d0f78915b5942aab07cffff140fa0ac23392362 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Fix qmlcompiler build on win32.Erik Verbruggen2015-10-291-2/+2
| | | | | | | | | | Change-Id: Ie1239b6ba5f5ba77dd081ad6392d962822d124dc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Export QQmlLocale privatelyJ-P Nurmi2015-10-281-1/+1
| | | | | | | | | | | | | | | | Allows QQuickSpinBox to call QQmlLocale::wrap() to be able to pass QLocale to QJSValue::call(). Change-Id: I01e4daccdc8bfe6a5c591819ac54bc51603268aa Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | QML: Fix typeof context property.Erik Verbruggen2015-10-2711-2/+99
| | | | | | | | | | | | | | | | This was missing from f21e8c641af6b2d10f0d7e7e0fc6a755dab3673c. Task-number: QTBUG-48524 Change-Id: I5cc6a979d965a1ef6b7fbc916a7ca9df868b459a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Binding: document that property can be grouped if it's a value typeMitch Curtis2015-10-231-0/+17
| | | | | | | | | | Change-Id: Ie33410027556857fefb87517ebb336c2714bc6c6 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | V4: do not run optimizer for functions of >300 statements.Erik Verbruggen2015-10-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The time it takes to run the optimizer depends on both the number of IR statements, and the number of basic-blocks. Many functions that have more than 300 statements are either the %entry point, or methods that set a large number of member variables. Both are not performance sensitive, so skipping them won't hurt execution speed. Actually, not optimizing them does improve startup speed. Basic blocks need to contain at least one statement (the terminator), so a large number basic blocks always results in at least an equal number of IR statements. Therefore they do not need to be taken into account. (An example of an excessive amount of basic blocks is a switch with 9000 cases: this will generate ~27000 basic blocks.) Change-Id: Iabf809d8ad293f4f27ece06d136aa281991a1b0f Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QML: file leak of QFileSelector.Erik Verbruggen2015-10-222-0/+8
| | | | | | | | | | | | | | | | When no "custom" file selector is set, the QQmlFileSelector would not delete the QFileSelector it created/owned. Change-Id: I0235d0dabdb8522db0b8b74a2a2d69ee5a20abb6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QML: Sanitize reading environment variables.Friedemann Kleint2015-10-228-30/+51
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Missing early n in co[n]version.Edward Welbourne2015-10-211-1/+1
| | | | | | | | | | Change-Id: I7ca28b42797a8f0781706af4ffd3e8f0dac41aa3 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Doc: Update examplesinstallpath to include the repository nameTopi Reinio2015-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The examplesinstallpath variable in .qdocconf files defines the path under QT_INSTALL_EXAMPLES where examples are found. To match the way examples are packaged in Qt 5.6, prefix each install path with the repository name. Task-number: QTBUG-48736 Change-Id: Ic081654ad3dfb87d3053772fabd5546c75070a7c Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* | JS: Math.random(): fix range to not include 1.0.Erik Verbruggen2015-10-201-2/+7
| | | | | | | | | | | | | | | | | | | | | | [15.8.2.14] specifies that the Math.random() returns a number greator or equal to 0, but less than 1. Libc however defines it to be less than or equal to 1, so we have to divide the returned value by RAND_MAX+1. Of course, in order to do this, we need to widen them to 64bits ints. Task-number: QTBUG-48753 Change-Id: Ia4d808014dbf2a5575f4226779214bf0d5981f49 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Doc: solved various qdoc errors qtdeclarativeNico Vertriest2015-10-201-7/+7
| | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I2e9fa91d63c5998df50f3678e485135e8518916d Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* | Properly resolve the context to create mutable bindings onLars Knoll2015-10-201-4/+13
| | | | | | | | | | | | | | | | | | This fixes a regression introduced in 5.5, where eval() calls in strict mode would still modify outer properties. Change-Id: I3ab70b45217eea16da68a4537e3c107b76794f2c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Fix a crash when copying array dataLars Knoll2015-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | Regression from 5.5. d()->arrayData->alloc can be larger, but never smaller than the allocation of the other's array data. Change-Id: I7d2265768f9d6e6298bfbba0d674a4d0e642422f Task-number: QTBUG-48727 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Nikita Krupenko <krnekit@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QmlDebug: Add a debug service for use with native debuggershjk2015-10-162-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This service provides information about the state of the most recently used QmlEngine in a way that can be integrated with "native" debuggers (GDB, LLDB, potentially CDB). Unlike the existing QV4 debugger service, the data extraction is triggered by direct calls from the native debuggers, i.e. has the examined QmlEngine stopped at the time of inspection. Since roundtrips through the native debuggers are expensive, an additional goal is to minimize roundtrips. Change-Id: Ic420129bbc15162197e35b52d92e882c027c9f6d Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* | QmlDebug: Don't duplicate Qt namespace when importing debug pluginsUlf Hermann2015-10-161-1/+3
| | | | | | | | | | | | | | | | | | | | Q_IMPORT_PLUGIN already adds the Qt namespace to the symbols. Task-number: QTBUG-48415 Change-Id: I25b4ffdcddd0bdd52bfd390964b9c1a333a79b30 Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QmlDebug: Add a debug connector for use with native debuggershjk2015-10-161-3/+12
| | | | | | | | | | | | | | | | | | | | This debug connector offers a few simple C functions a native debugger can hook into to communicate with QML debug services. It is the base of the 'native mixed' debugging mode in Qt Creator. Change-Id: I32ce1f21be8e3522dccf1210d4de3b131b819bc5 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* | Make obj2's text consistent between qtBinding.[23].qmlEdward Welbourne2015-10-161-1/+1
| | | | | | | | | | | | | | | | The expected text output sides with .3.qml, so fix .2.qml Task-number: QTBUG-48652 Change-Id: I91ac0ab0854df95e06225938d195cd5e3be5abc3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Only set V4 debugger when service is enabledUlf Hermann2015-10-151-1/+0
| | | | | | | | | | | | | | Otherwise different debug services could steal each other's debugers. Change-Id: Ic0a50333d21c7d20a7124240ea598f8446400ae3 Reviewed-by: hjk <hjk@theqtcompany.com>
* | Don't delete singletons objects owned by C++.BogDan Vatra2015-10-151-1/+6
| | | | | | | | | | | | | | | | | | | | This way we can enable the usage of a single singletons in both worlds. Currently singletons are destructed before the other QML types, and using a singleton that is owned by C++ we don't need to care about the destruction order anymore. Change-Id: I120fcb8659e16321ae6e70c7b0d62be3bc650d73 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Doc: fixed compilation and link errors qqmlitemmodels.qdocNico Vertriest2015-10-151-20/+20
| | | | | | | | | | | | Change-Id: Ifed9787a4fc00a235faf043dbb0b1871fbfa9b06 Task-number: QTBUG-43810 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Doc: corrected syntax errors \qmlmethodNico Vertriest2015-10-151-2/+2
| | | | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I694e9046ba32144b084277637b47d7ce23c633a9 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Align QQmlVMEMetaData to int.BogDan Vatra2015-10-151-2/+1
| | | | | | | | | | | | Task-number: QTBUG-48139 Change-Id: I12bec1ec72a99de0c3f5b4b12d22fba2b66c8f49 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>