aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-1614-43/+176
| | | | | | | | | | | | | | | | | | | 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-163-10/+25
| | | | | | | | | | 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>
* Doc: Describe new 5.11 features in Image elementv5.11.0-beta4Eirik Aavitsland2018-04-133-2/+113
| | | | | | | | Add user documentation of the compressed texture file support and the file extension auto detection. Change-Id: Icfae8574dd3acba30e8275ccd6ff3438fa037868 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickShapeGenericRenderer: Fix clang-cl-warning about uninitialized variableFriedemann Kleint2018-04-121-0/+1
| | | | | | | | | Add a return to the default branch capturing NoGradient, fixing: warning: variable 'gradMat' is used uninitialized whenever switch default is taken Change-Id: Iad9d619b59677a18a0718d750516c9b2fe51569d Reviewed-by: Laszlo Agocs <laszlo.agocs@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>
* Make QSGLayer::grab work correctly in software rendererJan Marker2018-04-114-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Fix three separate issues: 1. It was possible that the QSGSoftwarePixmapRenderer's background image's rectangle was set to a non-normalized rectangle. That would have led to the damage area detection creating an empty QRegion for the damage area and QQuickItem::grabToImage would grab an empty image. 2. The QSGSoftwarePixmapRenderer was rendering the image vertically mirrored compared to what its equivalent in the OpenGL backend was doing. Therefore QSGLayer::grab was vertically mirrored, too, so QQuickItem::grabToImage would grab a mirrored image, too. Additionally QSGSoftwareInternalImageNode (used by QQuickShaderEffectSource) now has to mirror its internal texture if that one is a QSGSoftwareLayer. 3. QSGSoftwareInternalImageNode (used by QQuickShaderEffectSource) was not updating correctly when mirroring (with the fix for 2 also in case of a QSGSoftwareLayer as texture). Related to QTBUG-63185 and QTBUG-65975. Change-Id: I0d0ead7fb1c839a8ff427ff7881d8a881e538409 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Pass on tab presses to the offscreen window to handle firstAndy Shaw2018-04-115-1/+179
| | | | | | | | | | | | | | When pressing tab/backtab then the offscreen window needs to pass it on to the item in case it will handle this for changing focus. If it does not handle the event, it will pass it back for QWidget handling. [ChangeLog][QQuickWidget] Tab presses are now passed on to the root item to be handled first. When not handled by the root item, it will be handled like a standard QWidget. Task-number: QTBUG-45641 Change-Id: Ief0552ba496c87ab0b6e12aa8e67ef44b5a20ae2 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Warn about non spec compliant extension being usedLars Knoll2018-04-113-4/+10
| | | | | | | | | | | | 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 plugins.qmltypes for QtQml installation in static buildsSimon Hausmann2018-04-101-1/+1
| | | | | | | | | | | | Mention plugins.qmltypes in AUX_QML_FILES to ensure that it is always copied to the build directory. qml_module.prf usually takes care of this by having QML_FILES in qmldir.files with INSTALLS += qmldir, but with CONFIG += builtin_resources (set for static) that's not the case. AUX_QML_FILES is the correct variable though. Task-number: QTBUG-67600 Change-Id: I4291b942e14ca26749758c3511240f824288f07e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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-093-30/+69
| | | | | | | | | | | | | | | | | | | | | | | 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>
* clear() the loader before destroying itLars Knoll2018-04-091-4/+1
| | | | | | | | | | | This prevents bindings in children being evaluated and removes spurious qml errors on the command line. Amends 2eb2d6386da304cd1164264ae0bff685c796d89c. Task-number: QTBUG-63729 Change-Id: I88b85ed40c6b8c5fbb422831055942cc0f4ee424 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash when QML engine warning handler feeds errors back into QMLSimon Hausmann2018-04-096-33/+15
| | | | | | | | | | | | | | 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>
* Improve QQuickItemGrabResult::image() docsMitch Curtis2018-04-091-1/+1
| | | | | | | | | It can return a null image. An "empty" image is confusing, as there's no function in QImage with that name, requiring the user to consult the docs. Change-Id: Iaa805510804162fe3a7df00394b4a9ad61ac1d20 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Avoid marking hidden windows as updatePending in Gui render loopDavid Edmundson2018-04-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Since eeb320bbd8763f3e72f79369cc3908e999a0da3c the GL context only deletes textures when all windows with pending updates have finished rendering. renderWindow will not process any window that is not visible. This leaves a logic bug that we can have the updatePending flag set but never cleared. If we have two windows, this leaves the other window still updating normally, but lastDirtyWindow will always be false and we never call endSync. This results in an effective memory leak of all textures. This patch resets the flag on hide() a move that can be considered safe given the show() method will reset this flag anyway. Change-Id: Iab0171716e27e31077a66b5e36a00bf28a2e7a8c Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Aleix Pol Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Remove erroneous examplePaul Wicking2018-04-091-10/+8
| | | | | | | | | | The current documentation is not current anymore. Removed faulty example and added link to relevant page for more information. Task-number: QTBUG-67082 Change-Id: Ic2d29ab358b227289480d9986679676048a35821 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Improve the "Interacting with QML from C++" sectionMitch Curtis2018-04-091-4/+20
| | | | | Change-Id: I8930314179514d091a39640551f2816a23cbebc8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Flickable mouse wheel handling on macOSNils Jeisecke2018-04-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On macOS a special movementEnding timer was added to the wheelEvent handling to fix QTBUG-63026. This has introduced a regression with wrong vData/hData.moving flags: When the timer fires before the Qt::ScrollEnd phase is reached, movementEnding is invoked early (can be reproduced with very slow scrolling using the Magic Mouse). In this case movementEnding sets vData.moving = false but not vMoved = false because scrollingPhase is still true. This will prevent any further invocation of movementStarting from inside the drag method (it expects a change in vMoved) so once this situation has occurred the "moving" flags will be out of sync. Visible effect: If a ListView has a currentItem set with setCurrentIndex, its viewportMoved method will no longer correctly set the moveReason to "Mouse" because the check depends on "moving" flag as an indicator for mouse interaction. This results in the view permanently jumping back to the current item on any scroll operation because the moveReason will be stuck at "SetIndex". The fix is to ignore the timer event if scrollingPhase is still true. Task-number: QTBUG-67460 Change-Id: I7cf02b8c625b7baf249ad26c4e0c3df874a18eae Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlDebuggingEnabler test: Relax output string conditionUlf Hermann2018-04-061-4/+8
| | | | | | | | | | | | Apparently the "qml: " prefix to strings output via console.log() is not reliable. We can also get "qml <function> - ", as seen in the test log. Also, increase the timeouts. The test log indicates that they are too small. Change-Id: Icb0da329e52273f9300504047b79b1ad41c02892 Task-number: QTBUG-67505 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Allow for QQmlData::set*Bit and clear*Bit to be inlinedErik Verbruggen2018-04-062-66/+70
| | | | | Change-Id: I216adf12e7ec402f3ccb4f846165171c9833f23b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Change the section title to avoid a linking conflictVenugopal Shivashankar2018-04-061-1/+1
| | | | | | | Otherwise, all links to the Qt Quick Layouts module page will lead here. Change-Id: I04c14ca9a28ebf0e19e489229352ba4d11f24859 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Improve documentation for qmlRegisterType<Foo>()Mitch Curtis2018-04-051-0/+68
| | | | | | | | Explain when it should be used. Task-number: QTBUG-67332 Change-Id: I759a192778a0370831f44b871e58c5ee49d3fe3c Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Link to C++ => QML flowchart in QML registration function docsMitch Curtis2018-04-051-4/+13
| | | | | Change-Id: I684bf2c461be5ebc78df06c816a0717d5958e0de Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: correct Sprite's detailed descriptionMitch Curtis2018-04-051-2/+2
| | | | | | Task-number: QTBUG-58641 Change-Id: Ib339746d459328bdac8fa0eeff80300df99ff482 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Add a section on scalable application UIVenugopal Shivashankar2018-04-054-6/+48
| | | | | | | | Also fixed a grammar issue and a few broken links. Change-Id: I807da06536d6a9101e67fd73858cbbfe90d00663 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add a flowchart to aid choosing the correct C++ => QML integrationMitch Curtis2018-04-053-0/+6
| | | | | | | | | | | http://doc.qt.io/qt-5/qtqml-cppintegration-overview.html is currently a scary wall of text. A flowchart is something that is very easy to follow, making it much easier for users to choose the correct C++ => QML integration method for their situation. Change-Id: If684126395054c69e4583844aa0d7c0ff525c7a1 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Examples: remove bogus returnv5.11.0-beta3J-P Nurmi2018-04-031-1/+1
| | | | | Change-Id: I653974c80c6767d9af95b9157a73c09dbdeb76cc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* qmltest: Use correct Testlib headerFriedemann Kleint2018-04-031-1/+1
| | | | | | | | | | Fix warning: QtTest/qtest_global.h:4:4: warning: #warning Header <QtTest/qtest_global.h> is deprecated. Please include <QtTest/qttestglobal.h> instead. [-Wcpp] introduced by qtbase/4db38197c2bac8bcee9d08a0e20ed2c8d127b8f2. Change-Id: Icb5b17d8680f9dc02f43fa9cf06f516cbef3de87 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix debug-and-release builds with CONFIG += qtquickcompilerSimon Hausmann2018-03-311-1/+1
| | | | | | | | | Allow for QMLCACHE_DIR to be pre-defined when modified with debug or release suffix via exclusive_builds_post.prf. Task-number: QTBUG-66675 Change-Id: I007fd8359a860e4c7c2b3efdd90a678ddaad72c3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QmlProfiler test: Keep recording until we receive the needed eventsUlf Hermann2018-03-281-2/+15
| | | | | | | | We can apparently catch the engine at a point where it has already registered but not compiled anything. Change-Id: I09cd7fefe731a61a6f2095e125516ecf57c602cb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Drop the use of QT_PLUGIN_PATH in documentation configTopi Reinio2018-03-283-48/+5
| | | | | | | | | | | | This caused build issues in certain configurations. We don't actually need it, as we can rely on the base Qt include path instead. Also move the custom header under src/quick/doc and rename it. Task-number: QTBUG-67342 Change-Id: Id75e140f9d286f6a47c2ecc039bfb52b13a92608 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Fix QQmlExpression::hasError()/error() on syntax errorsSimon Hausmann2018-03-273-10/+15
| | | | | | | | | | | | Record errors that happen during QV4::Script::parse() time in the same way as we record errors during binding evaluation, in order to correctly set the error state of QQmlExpression. This also removes dead code about setting line, description, etc. which is taken care of by ExecutionEngine::catchExceptionAsQmlError. Task-number: QTBUG-67240 Change-Id: I2d586e16803d0883cdd2d1d262b4c67202c00562 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix CONFIG+=qtquickcompiler with paths that contain spacesSimon Hausmann2018-03-275-0/+26
| | | | | | | | Map spaces to underscores as well. Task-number: QTBUG-54683 Change-Id: Id73c086a2845111623df631c06733ba2b42249e0 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* qtquick_compiler_add_resources() with spaces in pathsSimon Hausmann2018-03-274-3/+3
| | | | | | | | Ensure a quoted path when constructing the command line for rcc -list. Change-Id: I43e31015e3de58f65f46d2e594cb362d71b123ed Task-number: QTBUG-57758 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Improve QtQuickCompiler cmake testsSimon Hausmann2018-03-274-6/+31
| | | | | | | | Perform not only a build test when running the cmake tests, also run the resulting testlib based binary to verify the toolchain end to end. Change-Id: Ic962edf10b810b36f3feb68df55e7230841865d6 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Qml Profiler: Store and send URL of compile eventsUlf Hermann2018-03-272-1/+37
| | | | | | Task-number: QTBUG-67354 Change-Id: I7251095570d5ba8d0a62d854cfcbc339b2455747 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Yarr: Add Q_FALLTHROUGH to silence GCC 7 warningPeter Varga2018-03-271-0/+1
| | | | | Change-Id: I258b5ea84a96f5269b241c9b0cce53202c19c61a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QQuickPointerHandler: make classBegin and componentComplete protectedShawn Rutledge2018-03-272-5/+13
| | | | | | | | | They are public in QQmlParserStatus but don't need to be public here. Also de-inline the default implementations, because this class will be public C++ API eventually. Change-Id: Ic7dfbec853e3d20f45b361401f710dedb5eae416 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QML Tooling: Don't send StartTrace if we haven't started any profilersUlf Hermann2018-03-271-2/+1
| | | | | | | | | | If the client requested the trace to be started before any engines were registered, this would result in a StartTrace with an empty list of engines, which would never be matched by an EndTrace. This is rather confusing. It's better to send nothing at all. Change-Id: I8728628bd7c9fe068f7275c499440f95542dcc11 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use a separate process for testing perf.map fileUlf Hermann2018-03-274-68/+99
| | | | | | | | | | | | The environment change was too fragile. If the JIT ran before the relevant test function was executed, it would set the doProfile flag to false, and never re-evaluate the environment variable. The qmljs binary is only available for private tests, and the test didn't quite fit into qjsengine anyway. Therefore a new test for the QV4Assembler class that genertes the map files is added. Change-Id: Ice0c18daaee9f0f4f0f15eba0261bcc01aa4b105 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML Tooling: Wait for QML trace to be started in QML profiler testUlf Hermann2018-03-271-0/+3
| | | | | | | | | | If we don't wait for anything else, we need to wait for at least the "trace started" message before we disable profiling. Otherwise we might disable the profiling before the first engine registers, which will give us no trace at all. Change-Id: I9fb64e82bd05c60640ffbbd2ece5e99edfa97f4a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML Tooling: Remember global "enabled" flag in profiler serviceUlf Hermann2018-03-272-1/+14
| | | | | | | | | | If profiling has been enabled for all engines, that now also holds for engines to be registered in the future. This way the client doesn't need to employ the EngineControl service just to figure out when the first engine registers. Change-Id: I44a441bb6ead25abdadac1ae3e4edf9b0a9659f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>