aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* wasm: rename Q_OS_HTML5 to Q_OS_WASM to reflect qtbasewip/webassemblyLorn Potter2018-07-183-4/+4
| | | | | Change-Id: I088ae6e7d7c16a88cc6bcf2eb97898db83df4724 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* wasm: fix assert crash in debug modeLorn Potter2018-06-201-0/+10
| | | | | Change-Id: Ieb72f57bc75465e938538dd6079f43ba49cbed3c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: cleanup code, remove obsolete codeLorn Potter2018-06-077-11/+9
| | | | | Change-Id: I54f406d803fa6d458ae53a78abb8c99dc76aab92 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'gerrit/5.11' into wip/webassemblyMorten Johan Sørvig2018-06-0426-148/+162
|\ | | | | | | Change-Id: I7556ac62fd8e1aeb99186c929f1225f02f9d2430
| * V4: Set argumentsCanEscape when debuggingUlf Hermann2018-05-301-0/+2
| | | | | | | | | | | | | | | | | | This causes the updated arguments to be reported to the debugger when they are overwritten in the function body. Task-number: QTBUG-68534 Change-Id: I30c22d31aa97da0d58a4bbaaa032180a919669a8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Formals come after locals in the CallContextLars Knoll2018-05-291-4/+5
| | | | | | | | | | | | | | | | | | | | | | The method updating the internal class for a CallContext messed up the order between locals and formals, leading to wrong name lookups for signal handlers taking implicit arguments Task-number: QTBUG-68522 Change-Id: I36d55b3b0cfe9af6397455782551498b7ddb940a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix a crash in the modulus operationLars Knoll2018-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | INT_MIN % -1 crashes in C++ with an arithmetic exception, so avoid passing negative numbers into the integer operation, use fmod() instead. Task-number: QTBUG-68513 Change-Id: Ib5a37b55a0f9d41a84c7e6c00ea3f87622155de5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Remove old pre-QFileSystemEngine-rewrite codeErik Verbruggen2018-05-281-9/+1
| | | | | | | | | | | | | | | | | | | | | | Once upon a time, calling stat directly on Unix-alike systems gave a significant speed-up compared to calling QFile::exists. These days not so much. It also breaks any use of custom subclasses of QAbstractFileEngine. Task-number: QTBUG-68463 Change-Id: Icae8a16880723dee13c460cfdb15b03dc63c1371 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix build for Android with android-clangLiang Qi2018-05-251-2/+1
| | | | | | | | | | | | | | | | | | | | jit/qv4assembler.cpp:65:11: error: unused variable 'IsIntegerConvertible_Shift' [-Werror,-Wunused-const-variable] const int IsIntegerConvertible_Shift = QV4::Value::IsIntegerConvertible_Shift; ^ Change-Id: I8fd7f03661e9bb7d80c92947cd43841189f148ce Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| * Fix crash when modifying list model in worker threadSimon Hausmann2018-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we call get() on a model in a worker thread, we may end up creating a ModelNodeMetaObject (aka cacheObject). Subsequent mutation of properties may make us end up in emitDirectNotifies(). However since we can't have bindings in there, we should shortcut/suppress the notify emission, which we can do by checking ddata->context via qmlEngine(). The previous code crashed when qmlEngine() return a null pointer but QQmlEnginePrivate::get(const QQmlEngine *) would attempt to dereference the parameter. Started-by: Slava Monich<slava.monich@jolla.com> Change-Id: I880619c686436c053692faafa5dba2c96c2ace96 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Slava Monich <slava.monich@jolla.com>
| * On network redirects, update finalUrl, not urlUlf Hermann2018-05-231-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want all further imports to be relative to the redirected URL, not the base one. Note that this will incorporate any prior URL interceptions into the final URL if a redirect happens. We don't really want this to happen because the result of interception is not meant to be the base for further URL lookup. However, as interception occurs before redirection, this is unavoidable. Don't use URL interceptors on remote URLs. Task-number: QTBUG-67882 Change-Id: I2717bdd4de119ac67caa08fdccc041432025abff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix change-of-sign warningThiago Macieira2018-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | Column numbers cannot be negative. error #68: integer conversion resulted in a change of sign int value = v8engine->consoleCountHelper(scriptName, frame->lineNumber(), -1); ^ Change-Id: I052407b777ec43f78378fffd1531182f28e09b1f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix crash when incubating objects with non-existent initial propertiesSimon Hausmann2018-05-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When incubation is triggered from C++ and reaches the state of setting the initial properties (as supplied to incubateObject), we'd set engine->currentStackFrame to a CppStackFrame that provides access to the correct QML context. As we're not called from the interpreter, the v4Function pointer would be a null pointer. If during the initial property setting an exception is thrown (due to non-existent property access) and a back-trace is created, we'd end up dereferencing v4Function. Change-Id: I7f6b0ba7893bfb4186f55d4c213b4bb602d29aa0 Task-number: QTBUG-68416 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix crash when modifying objects used as prototypesLars Knoll2018-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing the prototype of an object back and forth leads to a 'cyclic' reference in the internal class transition tables. If one of those objects then gets a new property, we would get an infinite stack recursion trying to update the internal class IDs of the classes using this prototype. Fixed by skipping protochanges and vtable changes in the update code. That's ok, as those classes will always be reached through other paths from the empty class. Task-number: QTBUG-68369 Change-Id: Ie54ca5171a92f8e8b146a91376e435478ff70185 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Ensure we restore QML-defined enumsMichael Brasser2018-05-231-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | This code path was previously missed, leading to some AOT-compiled types generating errors of the form: Unable to assign [undefined] to int [ChangeLog][QtQml] Fix QML declared enums with CONFIG+=qtquickcompiler. Change-Id: Ib46a2b2505aa3863f091a6ccdebf8425e62fc38f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix .import within .js files with CONFIG+=qtquickcompilerSimon Hausmann2018-05-113-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading a .js file without QQC, we scan the sources and use the ScriptDirectivesCollector to extract things like .pragma library or .import ahead of time. That information is passed on to the compilation unit generator for serialization. When compiling .js files ahead of time, we also used the same collector, but we forgot to save the data into the right location before serialization, so we essentially lost the imports. This patch fixes that by centralizing this code into the ScriptDirectivesCollector itself. [ChangeLog][QtQml] Fix regression with .import in .js files not working when using CONFIG+=qtquickcompiler. Change-Id: I5413c14b1b8bd3114a997011534fe55cdb7634aa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix build without features.timezoneTasuku Suzuki2018-05-111-1/+1
| | | | | | | | | | | | Change-Id: Id40b7a9394a9027551a1334e9e520630e8967cb7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Merge remote-tracking branch 'origin/5.11.0' into 5.11Qt Forward Merge Bot2018-05-092-10/+17
| |\ | | | | | | | | | Change-Id: Id292599780ae47c6f2f3fa2d3bbc542b113bd16b
| * | Fix loading of composite singletons from resourcesSimon Hausmann2018-05-083-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f6bbeeb417102c61e8bf23f41e412ed9753a348d began normalizing the resource urls in the type loader, which broke loading of qml singletons from resources, as the normalized url is also used for the "pragma singleton" verification to check that the singleton is in the meta-type registry. If the registration was done with a non-normalized url, the check would fail with a misleading error message. Task-number: QTBUG-68025 Change-Id: I1093ee0cbee884b4a51195c302c8908f748e747e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
| * | Fix QML context leak with visual data model and list property modelsSimon Hausmann2018-04-303-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the VDM or QML list properties as models, the delegate model injects an intermediate QQmlContext that provides access to the properties of the exposed QObject as context properties. Before commit e22b624d9ab1f36021adb9cdbfa9b37054282bb8, that context was marked to be owned by the parent QQmlContext. When the reference counting was introduced, that parent became referenced from the cacheItem (DelegateModelItem), but that intermediate QQmlContext became floating and was leaked. This can be observed by running the objectListModel test of tst_qquickvisualdatamodel with detect_leaks=1 in ASAN_OPTIONS. The leak is fixed by re-introducing the exceptional case of a parent holding a strong reference to the child, in just this one case. Change-Id: Iabc26990d39757b0abe0cddf69e76e88e40fba40 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * | QQmlDelegateModel: include QQDMIncubationTask errors with our errorsMitch Curtis2018-04-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the snippet in the referenced bug report (and the parent patch applied), the output is: qrc:/main.qml:19:19: QML ListView: Error creating delegate There should be more errors after this line, but since the delegate itself didn't have any errors, we need to also check with the incubation task. After doing so, the output becomes: qrc:/main.qml:19:19: QML ListView: Error creating delegate: qrc:/main.qml: Object destroyed during incubation This adds important context (for developers and for users reporting issues in the future) that was previously missing. Task-number: QTBUG-49224 Change-Id: Ic7ac1a06c7dbdf3746f960d28908cc10f6ae86f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Fix qmlInfo and friends for anonymous componentsSimon Hausmann2018-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | When used on for example delegates we can and should also print the line number and column where the component is declared. Change-Id: I0f02c675425700cde119352d0001895cc31a4c73 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * | Normalize URL before loading typesErik Verbruggen2018-04-272-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents loading of types with slightly different paths multiple times, like "qrc:/One.qml" and "qrc:///One.qml". Task-number: QTBUG-65723 Change-Id: I6e26db6d1d271b2ed37b97eb990618843e99c372 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | QQmlDelegateModel: provide better warningsMitch Curtis2018-04-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, QQmlDelegateModel errors look like this: <Unknown File>: QML VisualDataModel: Error creating delegate This patch uses the delegate as the QQmlInfo object so that we get errors with actual file names and line numbers: qrc:/main.qml:19:19: QML Component: Error creating delegate This has several benefits: - It's obvious which file is causing the issue - A clickable link in Creator's application output pane Task-number: QTBUG-49224 Change-Id: I0df0d1a9e898aff5f83131ca62a47cc7f1c74c6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * | Clarify ownership around QQmlEngine::setNAMFMårten Nordheim2018-04-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were leaking an instance of MyNetworkAccessManagerFactory in the "NetworkAccessManagerFactory"-example. To add to this the documentation around QQmlEngine::setNetworkAccessManagerFactory did not specify whether or not it took ownership, causing confusion. Change-Id: Ic9eee2c45682c752bcb4aa98943fc0af2b630795 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | Fix JIT build on INTEGRITY ARM64Kimmo Ollila2018-04-264-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -typedef "Jump" may not be used in an elaborated type specifier -explicit specialization of function must precede its first use -"Value" is ambiguous Change-Id: Ic15c196f1b33211cd3f2f25a54ba478747336fe4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
| * | Enable JIT on INTEGRITY ARM64Kimmo Ollila2018-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch enables JIT on INTEGRITY s820Am and other ARM64 builds Change-Id: I2fa130f41a6c5bc6aa86bcfd5a01c2d431300561 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
| * | Make QtQmlDebug independent of QtQmlUlf Hermann2018-04-241-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means QtQmlDebug needs its own qqmlprofilerdefintions.h. This is a good thing because this way we notice if we change the definitions in an incompatible way. The test uses QtQmlDebug after all. Also, qqmldebugserviceinterfaces_p.h is not available anymore, which means the service names have to be spelled out. This, also, is beneficial as it prevents us from accidentally changing the names. In the context of QmlDebug we don't need to namespace the profiler definitions, either. This simplifies some code. Task-number: QTBUG-60996 Change-Id: Ibb39e48c9b758687d68b8ce4431f45eb26939a09 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | webassembly: fix for crash and assert on no thread and wasm buildsLorn Potter2018-05-142-30/+4
| | | | | | | | | | | | | | | | | | | | | This change requires moveToThread change in qtbase Change-Id: Idf35af4b416f577dabb91f749929dbfe5c88a0f0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Merge remote-tracking branch 'origin/5.11.0' into wip/webassemblyMorten Johan Sørvig2018-05-11100-625/+1082
|\ \ \ | | |/ | |/| | | | Change-Id: Ice58db1687c0cfbd5a19e84ca9fa81b8d3fa7959
| * | Only create CallContext objects for bindings that might be signal handlersLars Knoll2018-04-261-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating the callcontext for all bindings causes a 15% performance regression in both of the moving images benchmarks of qmlbench. But in most cases, we know that a binding can't be a signal handler, as those always have to start with 'on'. Take this into account and avoid creating the context for most binding expressions. Task-number: QTBUG-67782 Task-number: QTBUG-67783 Change-Id: I9a25cb916e374c7d03693e49646ca28853c6ba54 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Fix crash in Function.prototype.bindLars Knoll2018-04-241-7/+9
| |/ | | | | | | | | | | | | | | Allocating a 0 sized MemberData hits an assertion in debug builds. Change-Id: I0251b2b38f4b48c7ed35d22f88c0c5c4a98e6464 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Document latest QtQml.StateMachine import version to be 2.11Kai Koehne2018-04-201-1/+1
| | | | | | | | | | | | | | | | | | Since commit 214fbaa57b73296a0 the latest minor version of the import is automatically the Qt minor version, so let's also document this. Change-Id: I61a1015d74beaeac9d7a2aecd73e3f05c8a545c9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Document latest QtQml import version to be 2.11Kai Koehne2018-04-202-4/+4
| | | | | | | | | | | | | | | | | | Since commit 214fbaa57b73296a0 the latest minor version of the import is automatically the Qt minor version, so let's also document this. Change-Id: I232dcef923f3dfa5a6a2377bc8297b07fbe01f37 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Doc: Bump QtQuick import to 2.11Kai Koehne2018-04-191-1/+1
| | | | | | | | | | | | Task-number: QTBUG-67786 Change-Id: Ie371d4c931ce31f728cdd960ad454e26c40cc4ed Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Doc: Fix missing \endcode errorKai Koehne2018-04-191-1/+1
| | | | | | | | | | | | | | This got introduced in commit 67c9f735ce. Change-Id: I61a9a3886125cebe64f9eaa5ae1c7b8d226b2e1c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Fix memory leak when calling instanceof on QML itemsSimon Hausmann2018-04-171-0/+1
| | | | | | | | | | | | | | | | The return value of getType() has the ref count increased and needs handling on the caller side. Change-Id: I05ffa4dae221f2502f87b76762164bba1389db32 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Add note about revisions for grouped and attached property objectsMitch Curtis2018-04-161-0/+2
| | | | | | | | | | | | | | If they're not supported, it should be documented. Change-Id: I9219db1c9d31666e005074a863b04438052b3f05 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Document QObject::setProperty()'s behavior in relation to bindingsMitch Curtis2018-04-161-2/+17
| | | | | | | | | | | | | | | | | | Make it clear that setting a property via QObject::setProperty() will not break any binding already set on that property. Task-number: QTBUG-67451 Change-Id: Id032c2217a46133d1d6728598f79682dff459897 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Properly handle redeclarations of variablesLars Knoll2018-04-162-33/+38
| | | | | | | | | | | | | | | | | | | | This is only allowed for var type variables. Also fixes an assertion we'd run into with code such as let x; var x; Change-Id: I2588cf37e0964c879c60b4fd292e7d7b5476e322 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Remove a bogus assertLars Knoll2018-04-161-3/+1
| | | | | | | | | | | | | | | | | | It's actually possible to have oldLength != 0 and no arrayData in this code path if someone redefines the length property of the JS array. Change-Id: Ib699425b95fa1e1981483ccb2b2babd476b86f60 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix crashes when parsing destructuring expressionsLars Knoll2018-04-162-2/+3
| | | | | | | | | | | | | | | | | | | | x = [y] = z would crash because [y] is a literal and not a valid lvalue in ES5, something our parser didn't catch correctly. Change-Id: I0d7abd9b3f812f1de61c77dccfab5d1778dac793 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add a null pointer checkLars Knoll2018-04-161-2/+1
| | | | | | | | | | | | | | | | | | The data pointer in ArrayBuffer can be null, if the constructor tried to allocate an object with an invalid length; Change-Id: I4a37dfa2c749db02982c69ca065c2e7ce9902a93 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix calling Qt.binding() on bound functionsLars Knoll2018-04-1611-43/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling Qt.binding() on a bound function object is a valid use case and used to work until Qt 5.8. The problem was that we optimized the code in QQmlBinding and QQmlJavascriptExpression to directly work on a QV4::Function, so this wouldn't work anymore. To fix this make sure recursive calls to Function.bind() are unrolled (so that the BoundFunction's target is never a bound function itself), then add the bound function as an optional member to the QQmlBinding and use it's bound arguments if present. Task-number: QTBUG-61927 Change-Id: I472214ddd82fc2a1212efd9b769861fc43d2ddaf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix JSON.stringify with sequence typesSimon Hausmann2018-04-161-4/+4
| | | | | | | | | | | | | | | | | | | | Stringify::JA takes an ArrayObject* but it merely gets the length property and does indexed get calls. Those work also on array-like objects such as our sequence wrappers. Task-number: QTBUG-45018 Change-Id: I4ec4f89a2e09c918fbc2ff1d48ae5915e67ce280 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Qml/ArrayElementLessThan: Remove unused member variable thisObjectFriedemann Kleint2018-04-121-4/+3
| | | | | | | | | | | | | | Fix a warning by clang-cl. Change-Id: Ie9285a8937cdfa2640403b07b27ae938c5f61743 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Warn about non spec compliant extension being usedLars Knoll2018-04-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | eval("function(){}") would return a function object in our engine. This is not compliant with the ES spec, so warn about it, as it'll start throwing a syntax error in 5.12. Also fix the two places where we were using that syntax in our auto tests. Change-Id: I573c2ad0ec4955570b857c69edef2f75998d55a9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix crash with JIT on x86Simon Hausmann2018-04-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | The stack must be 16-byte aligned in order for compiler generated alignment requiring SSE instructions to work on the stack. For x86 the stack upon entry is 4 bytes off due to the saved eip. Then another 20 bytes for the saved registers (ebp, eax, ebx, etc.). That means we have to add another 8 bytes to reach the next 16-byte alignment. Change-Id: Ifde49a89224a129f8307fff3713563b80772cff1 Task-number: QTBUG-66773 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix leak of compiler contextsErik Verbruggen2018-04-104-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repeatedly entering a context that was entered before would result in leaking the previously entered context. This can happen when compiling child objects in a QML file, which is done recursively. So before compiling the bindings/function in the child object, first the global context and then the QML context are entered. The fix is to re-use the global context, as it's the same anyway for all objects in the same module. And we can remove entering the QML context, because nothing is in there, and we don't put anything in it ever. Change-Id: Ib1c4259d2dec22df46e96edb65bc3d377e52e671 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix XMLHttpRequest when used with QQmlEngine::evaluateSimon Hausmann2018-04-091-30/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our XHR implementation insists on a valid QQmlContext when processing callbacks. This is to protect against callbacks being triggered after dynamic QML contexts such as delegates have been destroyed. Unfortunately those checks are too strict and make it impossible to use XHR from within plain JS scripts (where v4->callingQmlContext() will return a null pointer). Dispatching the callbacks in functions that are directly called from QML/JS is safe and something we can do unconditionally. This applies to the callbacks triggered from abort() and open() for example. When we're called from QNetworkAccessManager we should enforce the continued existence of a QML context only if it was present at send() time. Task-number: QTBUG-67337 Change-Id: I8235f6ef407adc3eaeeff4eee72238ba6750afb2 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Valery Kotov <vkotov@luxoft.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>