aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Correctly set this object when calling scope/context functions5.6Erik Verbruggen2018-05-253-0/+30
| | | | | | | | | | | | | When a function is called that is in a QML scope or a QML context, set the 'this' object to the QML scope. Note: this patch is 5.9 specific. 5.11 has a similair issue, but the implementation is quite different, so that needs a separate fix. Task-number: QTBUG-59357 Change-Id: Ia78e012d413c40a094e957f4020502cd055ac286 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit b2420780df98cb3c98553da18a5b1bc5b64e9e83)
* Rebuild QQmlData::propertyCache if deleted by another engineDavid Edmundson2018-05-081-1/+6
| | | | | | | | | | | | | | QQmlData is shared between engines, but the relevant QObjectWrapper is not. Since 749a7212e903d8e8c6f256edb1836b9449cc7fe1 when a QObjectWrapper is deleted it resets the shared QQmlData propertyCache. In most cases the propertyCache except when a property updated in an existing binding in the first engine, where it currently asserts. Task-number: QTBUG-61681 Change-Id: I6efdc506e5c7e30b95cda1be282afa9feb781cd2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit ab5d4c78224c9ec79165e8890e5f8b8e838e0709)
* Fix JITted code for jump strict-not-equal undefined on 32bitErik Verbruggen2018-03-152-12/+50
| | | | | | | | | | | | | | The generated code for jump-on-strict-not-equal-undefined used the same logic (but with inverted conditions) as the equal case. For equality, one can jump to else if the value parts are not the same. So, for not-equal, if the value parts are the same, it would jump to the else block if they are the same. Meaning, an encoded int value of 0 (which is strict-not-equal to undefined) would end up being evaluated as equal. Task-number: QTBUG-66832 Change-Id: Id27bb44eccbf39608ae8cebab634c8bcd4c8adfc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Allow setting values in value type group properties in "on" assignmentsSimon Hausmann2018-02-263-1/+33
| | | | | | | | | | | | | | | | | | | Assigning to a group property inside a property value source or interceptor as part of an "on assignment" is perfectly valid. That is because while "color" is a value type property, the on assignment means we're actually setting easing.type (in the example and test) on the property value source, not the color, and that one is a QObject. The same goes for interceptors. Conflicts: src/qml/compiler/qqmlpropertyvalidator.cpp src/qml/qml/qqmlvmemetaobject_p.h tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I505a658977a578894d6dfb00bf5c65b41e42b12f Task-number: QTBUG-56600 Reviewed-by: Michael Brasser <michael.brasser@live.com> (cherry picked from commit 2659c308792967322564b5088e0e21bb371e0283)
* Fix ListModel.get(idx) == ListModel.get(idx)Simon Hausmann2018-02-233-10/+19
| | | | | | | | | | | | | | | | | | | | | | This is a regression introduced with commit 4876ea6a18ccdfd72014582aa5d50ab9f6b6ec9e. Where we previously always returned the same JS object, we would afterwards return a new JS object for every invocation, which breaks reference comparison. As we store the JS wrapper for the list element in the QQmlData->jsWrapper we can avoid repeated allocations. In order for that wrapper to keep working after modifications (insertion, etc.) to the list model, we have to replace the static element index with a reference to the node model meta-object, which also has an element index that however is kept up-to-date by the list model itself. Conflicts: src/qml/types/qqmllistmodel_p_p.h Change-Id: I4368de6b6d86687fe96fbf73bd60b80b69d7b058 Task-number: QTBUG-52017 Reviewed-by: Michael Brasser <michael.brasser@live.com> (cherry picked from commit 44a89492b49f23a975377795dbb7a48916cb5081) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix 2 use-after-free problems in the ListModelErik Verbruggen2018-02-224-39/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination of 2 commits that went into 5.9. They cannot be cherry-picked however, because some c++11 constructs were used. Hence this combo commit, which is a squashed version of those two commits that have the c++11 bits replaced by Good Old boilerplate code. Original commit 1 (e29ffa179e9920443a23e2fcb3f0694df32e8a68): Fix use-after-free when removing elements from a ListModel Detaching delegate instances from model items is done after the destruction of said model items. The problem is that after the model item is destroyed, it will emit a change/destroyed signal. As the delegate is still referencing the item, this will result in a use-after-free. To provent that, the items are kept around until after everyone (notably the delegate model) has been notified of the removal. [ChangeLog][Qt][Qml] Fix possible use-after-free when removing items from a ListModel through JavaScript. Original commit 2 (163c515783877b8b0ffb8b5c1bab288addee9745): Fix use-after-free when clear()ing all elements from a ListModel Same problem as the problem with remove(), so now clear will call into remove to do the correct thing. [ChangeLog][Qt][Qml] Fix possible use-after-free when clearing all items from a ListModel through JavaScript. Task-number: QTBUG-63383 Change-Id: I9a6bdf65da63b33833f18c80e74ad7bb93409627 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix memory leak with ListModel.getSimon Hausmann2018-02-132-3/+35
| | | | | | | | | | | | | | | | | | | This is a regression introduced with commit 3cc589c98390992e3ee8a7970dc2913ea857d623, which in turn fixed a leak with QV4::QObjectWrapper objects. Unfortunately the allocate() call into the persistent (weak) value storage in the list model introduced a leak of the weak value itself. This is fixed by replacing the free standing weak value allocation with the use of the existing jsWrapper weak value in the declarative data (QQmlData). That weak value is freed property in the destroy() method of the QV4::QObjectWRapper. The extra QQmlData allocation is hidden behind a unified allocation, similar to what we do in void QQmlType::create(QObject **, void **, size_t) const. Task-number: QTBUG-66189 Change-Id: I5351e3e484542709a6b210e84aa19b14d28e11ad Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 22d43f74e264626d0c28654c42c91839f9de45b5) Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix performance issues when handling layout changed in Quick item viewsMilian Wolff2017-11-164-43/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the layout changes, we mark all rows as changed but do not track where the individual rows get moved. The only reason why one would want to track the moves is to persist the current item selection across a layout change. But even the previous code did not achieve that. I'll create a follow up patch to this one that also implements this behavior as seen in Qt Widget item views. Note that removing this code brings a tremendous performance win on larger models. The repeated calls to _q_itemsMoved triggered O(n^2) behavior in the number of top items in the model. Even with "only" tens of thousands of items in the model, a layout change became very costly and took seconds on a beefy modern desktop machine. Calling _q_itemsMoved in a loop is bad because it: - leads to O(N^2) behavior within QQmlChangeSet when merging the small moves into the item view's current change set - potentially triggers tons of binding/property updates when the cached model indices are updated in _q_itemsMoved Removing this slow path, I did not yet find a behavior change to the previous code. Instead, it just does it all much faster. Change-Id: I67fa99a1c5d8e05d17497d29391da9458bd9bdd0 Task-number: QTBUG-51638 Task-number: QTBUG-45674 Task-number: QTBUG-53677 Reviewed-by: Daniel Vrátil <daniel.vratil@kdab.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> (cherry picked from 84f61dd2d2b0140814b39a2c5238a6e31c49abd7) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Bump versionOswald Buddenhagen2017-09-211-1/+1
| | | | Change-Id: Ic878796354a42cb5b6ba29b272c603ce762cf232
* QQmlTypeLoader: Guard enableProfiler() against QT_NO_QML_DEBUGGERv5.6.3Ulf Hermann2017-09-121-0/+2
| | | | | | | | If debugging is disabled, enableProfiler() is an inline empty function. Task-number: QTBUG-63118 Change-Id: I28fa7b7d3390482e7b0cc6419c5a1f47a5b9916f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlProfiler: Avoid race conditions in QQmlTypeLoaderUlf Hermann2017-09-075-15/+62
| | | | | | | | | | | | | | We have to make sure all profiler calls to one adapter are done from the same thread. It turns out that all the calls from QQmlTypeLoader are done from the type loader thread. By using a separate adapter for that, we avoid any extra locking. Task-number: QTBUG-62987 Change-Id: Ice400b1c3b7bd920d855ceb1ba0d46417f50348d (cherry picked from commit 4578a92744d447222f5e22851433d5dbecc51855) Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix QNX build on WindowsSimon Hausmann2017-09-064-4/+4
| | | | | | | | | | | | | | | | | | | Configure on Windows in Qt 5.6 does not detect the target gcc version correctly and reports the host gcc version instead. That means we'll end up enabling -fno-lifetime-dse with a gcc version that doesn't support it and consequently fail to build. Since in the 5.6 branch we only support QNX 6 and we know that the gcc version is 4.7 and thus not affected by the DSE problem, we might as well unconditionally disable the workaround there. This change is only for 5.6 as 5.8/5.9 and newer detect the gcc version correctly _and_ don't need the -fno-lifetime-dse workaround anymore. Task-number: QTBUG-62820 Change-Id: I55baf532a9126eb2f8c5f11858d52cccad6c355b Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Add change file for Qt 5.6.3Jani Heikkinen2017-09-061-0/+78
| | | | | | | Task-number: QTBUG-62707 Change-Id: I5ff6ddc2dfb1d495f20e257cbd014232cac335b7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit fb52a593893f52468c01c2c6c8eea0e5ca0cab82)
* Don't crash: Connections with a signal on a nonexistent objectShawn Rutledge2017-08-313-1/+25
| | | | | | | | Task-number: QTBUG-56551 Change-Id: Ide09f177d3f6a3e9902f8ea904b3e6e4b998bd39 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 02830aae1f3e9aaf89ca37637d40313babbff7b8) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash in QQuickAnimatedImageAleksei Ilin2017-08-152-1/+44
| | | | | | | | | | | Check d->_movie pointer before dereferencing Task-number: QTBUG-62380 Change-Id: I62314c7c0d4a7e41fa6f8c4629d16f30d6036156 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry-picked from fc3ecd2522deb3f6d8d48b66dbd89402e1ab4b53)
* Fix bug in designer support reference countingSimon Hausmann2017-07-271-0/+5
| | | | | | | | | | | | The QtQuick designer support may override the meta-object and reparent the property-cache of the object under editing. The code for replacing the parent of the property cache however was not handling the refcount of the _parent correctly. Change-Id: Ic73294fc208b297e8ec9c0b775b5da01a309dba6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> (cherry picked from commit 7dc5cd942eb5c55a26d539eedff48b2d6c8e0fc3) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Don't leak QQmlJavaScriptExpression errorsColin Ogilvie2017-07-271-0/+1
| | | | | | | | Ensure any error is deleted when the expression is Change-Id: Ibbfd28f50279d4c66830b40c5c917eb8d98f266e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 1e0685136d0debb2a3b62d9f4650c95afe41913b)
* Fix wrong grabbing behaviorFilipe Azevedo2017-05-161-0/+3
| | | | | | | | | | | | | | QQuickWidget::grabFrameBuffer() was not polishing its items nor syncing the scene graph compared to standard QQuickWindow::grabWindow(). This lead to QQuickWidget grabbed content to be outdated (render the previous frame as a new frame). Task-number: QTBUG-57596 Change-Id: I0a2eff0c4f84cfd432f60f9d2fc41ac6a723fa5e Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 0d243a89ac225f4080f16c93e4a6340d0ddc6f0e) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Fix build of animation benchmarkErik Verbruggen2017-05-121-0/+5
| | | | | | | | | This was using symbols exported only by a developer build. Change-Id: If2e80a7f7831366a23c5c52669915385cfb3e7c6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 720a88be5ba98a71a085ec5977d87ecb22c20008) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Another benchmark fixErik Verbruggen2017-05-122-1/+3
| | | | | | | | | | Again JS ownership, now shown as an attempt to free a non-malloced pointer. Change-Id: I00a9b1e4918da96aa5bc99a321edc94d76c4f45b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 63f0406cfbf58e8c3e3369beb8ae6995a7a21650) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Disable particle benchmarksErik Verbruggen2017-05-122-2/+4
| | | | | | | | | They are broken. See QTBUG-60621 for details. Task-number: QTBUG-60621 Change-Id: Ibf55c64ef1b367bc2058d1c2284cd378ffa826ec Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 23a3018fc6a1e650b7eb291009c20d46c9e5c9af)
* Fix qml file loading for tst_affectorsErik Verbruggen2017-05-122-5/+9
| | | | | | Change-Id: Ifb1b6f6d71d42c1642167725526c054f1dce0c90 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 9064d077e411aab9a2aea9f9e5a14ae029a94e14)
* Fix benchmark: remove benchmarks containing old v8 referencesErik Verbruggen2017-05-122-89/+2
| | | | | | | | | | | The removed benchmarks don't make sense anymore: they were testing the QQmlEngine part, while another test was doing the QJSEngine. These days the QQmlEngine is a subclass of the QJSEngine and the test would call the QJSEngine (which, as said, was already done in another benchmark). Change-Id: Id1982dc118c399938a2dca8fb3c0a733e52fb20e Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 9abcbbd3ab68da3cf7ee977c82b860e2ac42bb2c)
* Make sure we cannot reload debug connectors on shutdownUlf Hermann2017-05-101-1/+4
| | | | | | | | | | | | | The various Q_GLOBAL_STATICs involved in the loading of debug plugins may be destroyed in any order. If the connector is unloaded before the services, it might get reloaded when one service calls instance(), trying to de-register itself. Prevent this by clearing all the parameters. Change-Id: If0df8e7086e7e2a4d8701f61addd8c4a661aa349 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit fca6857529f9be982a75cd055fdc01e8d34413fb)
* QQmlComponent: Fix heap buffer overflow with bogus inputPeter Hartmann2017-05-092-0/+17
| | | | | | (cherry picked from commit 30dbe57521c9b1f4cac74db8f5f15a3c466c20d0) Change-Id: I20a030ddba6ae42b9959473fe68e622c6a42a8bf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a QJSValue benchmarkErik Verbruggen2017-05-092-2/+2
| | | | | | | | | | The benchmark added the tst_QJSValue instance driving the benchmark to the engine, which then takes over ownership. This would result in a use-after-free, leading to a crash. Change-Id: I524445487a1dabb3fb3fbbfb7fca084f7736c124 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 365d43a22050a4ea69e36b8d1033bf6ab3189264)
* Remove outdated QJSValue benchmarkErik Verbruggen2017-05-095-120/+2
| | | | | | | | | Now that the oterh QJSValue benchmark is fixed (yes, there were two benchmarks with the same name), this benchmark is superfluous. Change-Id: I39a7f9cc79dccef8aac3d4c3999a3d75e1b1aa3d Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 448104e4a09f66b62ff279d65ecc4658833e20f3)
* Fixed assertion failure when using QSG_RENDERER_DEBUG=uploadJason Erb2017-05-041-12/+14
| | | | | | | | | | | Added a check that Batch::drawSets is not empty. Task-number: QTBUG-48439 Change-Id: Ica76363be8c770240dc69c669815a60904e26988 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> (cherry picked from commit 893a4ffd6476a11597f9dd3c847fe3db4bf38eed) Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Jason Erb (Suitable Technologies) <erb@suitabletech.com>
* QML: clear the property cache on QObjectWrapper destuctionErik Verbruggen2017-04-262-0/+19
| | | | | | | | | | | | | If an external QObject is exposed to an engine through a QObjectWrapper, make sure to deref and clear the propertyCache reference in the object's declarative data when the QObjectWrapper is destroyed. This makes sure that there is no dangling propertyCache pointer when the object is subsequently exposed to another engine. Task-number: QTBUG-57633 Change-Id: I37f6793d8be65b23b4e81bb4ed91db18271261b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 749a7212e903d8e8c6f256edb1836b9449cc7fe1)
* Fix for dangling object pointers in QQmlErrorsRobert Griebl2017-04-191-1/+2
| | | | | | | | | | | | | | This rarely happens - only seen with Delegates - when - an object is created during incubation - some error occurs in this object - the object gets deleted before the incubation run finishes Because the errors are delivered after the incubation run finished, the object() pointer of QQmlError is now a dangling pointer that will crash your application if accessed. Change-Id: Idd9fccbc58e4ada67bde3ca1aeec736aa9374789 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 6a8a7e60ab91f958a1dd63e787a23f6e09f463b1)
* Prospective fix for static builds on Windows with QtQuickCompilerSimon Hausmann2017-04-031-6/+10
| | | | | | | | | Don't define QML_PARSER_EXPORT to dllimport when doing static builds. Task-number: QTBUG-59767 Change-Id: I24acb2c51f54a0cde8d2e50a935ede876e5eb5b7 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 3caf24c514e7b5dfe62dc656d48282f3816dd6cc)
* Fix build with GCC 7Marc Mutz2017-03-221-0/+7
| | | | | | | | | | | | | GCC 7 warns about preprocessor macros expanding to defined(), which the masm config macros use pervasively. Fix by suppressing the warning (-Wexpansion-to-defined). Task-number: QTBUG-59647 Change-Id: I9220741cf594824472bffc2305b994b311e55832 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 29bf17dee1497972152566af6916fd0a20b784ee)
* QtQuick scene graph: fix text native renderingOleg Yadrov2017-03-132-0/+135
| | | | | | | | | | | | | Only 65536 vertices (65536 / 4 = 16384 characters) can be drawn in one draw call. This is why QSGDistanceFieldGlyphNode (renderType: Text.QtRendering) creates subnodes if number of characters exceeds that limit. QSGDefaultGlyphNode (renderType: Text.NativeRendering) missed that logic for some reason. Task-number: QTBUG-58852 Change-Id: I88b3fcdb8e56bc92622d3347cd638634d43df138 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 42e098fa0ad318a6b6fafadbadce21b974c29c4d)
* Fix memory leak in V4Gunnar Sletta2017-02-031-1/+1
| | | | | | | | | | | | | | | | | | | Transitions contain both an id and a set of flags, but the sorting failed to take the flags into account in the operator<. As a result we would some times end up with duplicate entries if the same id was added multiple times with different flags. If the same id was added again and again with varying flags, this could lead to an ever expanding list filled with duplicate entries. Fix this by also taking flags into account in operator< so that operator< and operator== are symetric and the list gets correctly sorted. Change-Id: I6d55c67083e4a09e3eb2952edbec302389421f33 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 94324a4ea2261940d1d55dec141c885bf4f57832)
* Enable PropertyChanges to correctly restore binding on aliasMichael Brasser2017-02-033-13/+54
| | | | | | | | Change-Id: I88ffdd1d1224705e980e449b6c799c9f186143b1 Task-number: QTBUG-58271 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 22b03fd6d3efdfa0385ced2450c6c7dfcf555d6e) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Fix support for QJSValue as C++ signal parameter type, part 2Simon Hausmann2017-01-193-3/+14
| | | | | | | | | | | | | | | | | After commit 0e3380f9c6ab6e3ea7398caccf5aa84f1575f1cd we wouldn't crash anymore, if QJSValue::UndefinedValue was provided as value for a QJSValue C++ signal parameter. However that was not a complete fix for the regression of commit aa869cbb06bcf005e238059a2cb0205947ff0b5f, as other primitive values stored in QJSValue as QVariant were not converted, so for example QJSValue(42). So let's fix this once and for all by using QJSValuePrivate::valueForData, that handles all types of QJSValuePrivate encodings. Task-number: QTBUG-58133 Change-Id: Ib7c0461b18df6260ccd4bce729ae2348281eb7f3 Reviewed-by: Arnaud Vrac <avrac@freebox.fr> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 89c6bee139422b17534f79129eea2820d2ce952e)
* Accept PUA characters, ZWNJ and ZWJ as input in TextInput/EditEskil Abrahamsen Blomfeldt2017-01-174-8/+12
| | | | | | | | | | | | | | | Private Use Area characters are quite valid input characters when used in combination with a custom font. Joiners also serve an important language purpose in semitic writing systems. [ChangeLog][QtWidgets][Input] Support characters in Private Use Area, as well as zero-width joiners and zero-width non-joiners in input in TextInput and TextEdit. Task-number: QTBUG-42074 Task-number: QTBUG-57003 Change-Id: I62bcd2ab0784f7f731921fbcdd8c695c02b165e4 (cherry picked from commit 97e4d5d5aeb0d415db18c075f905763ae5ba5f18) Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash when C++ QJSValue parameterized signal interacts with JSSimon Hausmann2017-01-144-1/+8
| | | | | | | | | | | | | When converting the parameters of a C++ signal to JS values to provide to a signal handler written in JS, the conversion of a QJSValue to a QV4::Value* may yield a null pointer in case of a default constructed QJSValue for example. This is a regression from commit aa869cbb06bcf005e238059a2cb0205947ff0b5f and we must check for this. Task-number: QTBUG-58133 Change-Id: I528b606b2851dfb3072e54902bd8843d31571a55 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 0e3380f9c6ab6e3ea7398caccf5aa84f1575f1cd)
* Bump versionOswald Buddenhagen2016-11-281-1/+1
| | | | Change-Id: I9ee9754d3464f0cf33718267535ba6d054bbea10
* Doc: fix incorrect syntax in "Code-Behind Implementation Resource"Mitch Curtis2016-11-251-4/+4
| | | | | | Change-Id: Ie86302f12d4ad65ff46335a1ea248bbb4c5559f3 Task-number: QTBUG-56008 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QmlProfiler: Explicitly specify the offsets for scene graph eventsUlf Hermann2016-11-249-82/+172
| | | | | | | | | | | | | | The profiler can be switched on in the middle of a frame. In that case the last offset into the timing data would be some random number, which may lead to a crash when recording the sample. However, as we know all the data points we are going to record, we can as well specify where they are supposed to go. The timings themselves may still be random for frames of which we only recorded parts, but the clients can deal with this. Task-number: QTBUG-57304 Change-Id: I1d507f2591516e43d5b3cd25f7939716f2b64ed9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4: Fix JIT codegen for null/undefined conditional jumpsErik Verbruggen2016-11-231-2/+2
| | | | | | | | | When checking for undefined, both the tag and the value need to be checked. When loading the tag, it shouldn't end up in the same register that is used to hold the address of the QV4::Value. Change-Id: I380fce432ba489fdabe569dd2c9cac31e9905260 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improved robustness of the optimizer when removing expressionsSimon Hausmann2016-11-222-9/+14
| | | | | | | | | | | For example during dead code elimination we may invalidate statements, but at the same time there may still be instances left in the work list of optimizeSSA(). When we encounter then, we should not process them any further. Task-number: QTBUG-56255 Change-Id: I4c24b1a225ce1bde112172e9606f91c426c19f19 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Text: Make use of the new cached isSmoothlyScaled attribute on QFontEngineRobin Burchell2016-11-181-3/+5
| | | | | | | | | | | | | | | Relies on qtbase/f2205c48c21a6b135f2f59d0cf46e72f90f9f0f4. Asking QFontDatabase whether or not the font can be smoothly scaled is expensive Now that the attribute is available on QFontEngine, we can bypass all that. Benchmark results from qmlbench on creation/delegates_text on a 2011 mbp. Before: Average: 173.2 ops/frame; using 5/5 samples; MedianAll=173; StdDev=1.94, CoV=0.0112 - StdDev (all samples included)=1.94 After: Average: 180.8 ops/frame; using 5/5 samples; MedianAll=182; StdDev=1.94, CoV=0.0107 - StdDev (all samples included)=1.94 Change-Id: I56efd903037a29ee014de0cbf482cfbef7fce494 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix binding re-evaluation when list model properties changeSimon Hausmann2016-11-186-3/+91
| | | | | | | | | | | | | | | This is a regression from commit 4876ea6a18ccdfd72014582aa5d50ab9f6b6ec9e, which avoided returning an expensive QObject when calling get() but also lost the ability to perform binding captures when accessing the properties. This change restores the captures by performing them by hand in get() and also triggering the notifiers directly when the values change, without creating the QObject. Task-number: QTBUG-52356 Change-Id: Ia429ffafd4032b63d3e592aa63bb0864a24e0965 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: fix incorrect argument name for createQmlObject()Mitch Curtis2016-11-171-2/+2
| | | | | | | "string" is the argument type, not its name. Change-Id: Ia8f1afe01363eb6bfa69247aca5c0849c56000c4 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QML: Fix memory leak in a benchmarkErik Verbruggen2016-11-161-1/+4
| | | | | | Change-Id: I64b671243a107c518da2000e2ffd964f441af037 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* QML: Change C++ benchmark to reflect QML benchmarkErik Verbruggen2016-11-161-1/+2
| | | | | | | | | | The QQmlListReference will build a property cache entry, but it won't assign it to an engine when none is available (meaning: it would create the entry every time a QQmlListReference is created). QML won't do that, because it (obviously) has an engine available. Change-Id: I46eeaf3dffcb690902dd3d78be48c8509be6e84d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix reading of enum properties from gadgetsSimon Hausmann2016-11-162-0/+35
| | | | | | | | | | | | | | | | | QMetaProperty::type() maps an un-registered enum to QMetaType::Int, and so if a property cache is created for a gadget with enum properties, then their type will be int and we'll correctly read enum properties as ints in JavaScript. However if the enum is registered at the time we create the cache, then the property type will be the specific type and not QMetaType::Int. The property reading code in QV4::QObjectWrapper can deal with that, but the property reading code in the gadget value type wrapper code did not. [ChangeLog][Qt][Qml] Fix reading of enum properties from gadgets / value types when the enum was registered with qRegisterMetaType(). Change-Id: I7812b216a276dcc95c36e313507e1a1142250d0b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Doc: improve FolderListModel::rootFolder documentationMitch Curtis2016-11-151-3/+3
| | | | | Change-Id: I33ca6140d89041f89f0e3db9db7206aca50361d7 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>