Fix QQmlTypeNameCache object leak

Remove redundant ref to QQmlTypeNameCache object in
QQmlTypeCompiler::compile()

Change-Id: Ie166e8d04c1504194bec227bf5e945b273778a20
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix crash in qml/qmlscene when using dummy-data with imports

When using the tools qml and qmlscene with dummy-data it will crash or
behave wrong, due to the dummy-data component will get the state not
ready, if the dummy-data qml-files does an import of another folder or
a js-file.  By changing the way of loading dummy-data, by letting
QQmlComponent handle the file opening instead of using the setData()
method, qmlscene and qml will be able to handle this type of
dummy-data.

The tool qml also needed to load the dummy data before loading the
regular components, otherwise the dummy-data would not be ready for the
other components to use.

Task-number: QTBUG-32721

Change-Id: Ia1cc2b2626187e23c7d7313be788202d91b12471
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Fix CompiledData::CompilationUnit object leak

Don't ref CompiledData::CompilationUnit in constructor of ScriptFunction
since its has been referenced in its base class

Change-Id: I9ad2d6e190c2ac11de4ccd63015c81d2dead3971
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix QmldirCache object leak

Delete all the QmldirCache objects in the linked list

Change-Id: I9948ccce3d72aaed4f8b14b131e040177d7a15ef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix QQmlContextData object leak

Mark the QQmlContextData object created in QmlContextWrapper::urlScope()
as owned by its QmlContextWrapper to prevent leak.

Change-Id: Ie7afee676e0745a78ef4f3a56984f52f638227e0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Move Qt Quick Widgets example and document it

Because QtQuickWidgets is part of Qt Quick module documentation,
its examples need to also be moved under the examples/quick
directory structure.

This change moves the example, creates minimal documentation
for it, and adds a link to it from the QQuickWidget class
reference.

Task-number: QTBUG-37272
Change-Id: Iffb67849f150b9aaf0edaef5852364e93f7752b8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix WorkerScript object leak

Delete WorkerScrip object in WorkerRemoveEvent::WorkerRemove event

Change-Id: I1a304838e4a43577a5781216e32610ea36c5a7fd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Make sure QSGRenderLoop is cleaned up cleanly.

e13547c595913c58e6bd6a5ed80fdc729fae7d47 used a global static to clean
up QSGRenderLoop which is triggered very late, potentially after
SG backend API plugins have been unloaded. This results in crashes
when used in combination with scenegraph-playgrounds's customcontext.

Partially revert the change and instead clean up at the time of
QApp::aboutToQuit and make sure we also disconnect cleanly from
all QQuickWindows.

This change also ensures that QSGRenderLoop::windowDestroyed() gets
called for all QQuickWindows registered with the render loop. This
ensures that rendering stops and that scene graph nodes and resources
will be cleaned up regardless of whether the application has
remembered to delete the window or not. This is a good thing as it
makes the scene graph shutdown a bit cleaner.

Change-Id: I9cb9093979f8eac05542f118a6ff9cfe5c84f745
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Fix crash when appending arrays to sub models in list models

The elements are still inaccessible, but at least it doesn't crash. This is
consistent with the behavior in Qt 5.0, where it didn't crash because the v8
object handle returned an empty array for the property names because the
individual array element wasn't an object.

Bug QTBUG-12117 tracks support for arrays in list models.

Task-number: QTBUG-35891
Change-Id: Ief446341344977a1473bca474ca5ba934e950468
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
WinRT: Disable qml debugger autotest

As the test heavily depends on QProcess and QProcess is not implemented
for WinRT, this auto test should be disabled.

Change-Id: I765db54072ffaefe028b34d37090cfc2ad8dbd48
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Use stable sort when cleaning batches.

Ensure valid batches do not change order. This was causing rendering
issues when m_rebuild was 0, as we would not re-sort the list in correct
render order after cleanup.

Change-Id: I912fb313d4029f96e263fad24d68462f252003df
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix crash on shutdown with states

When populating deferred properties, we must not set the rootObjectInCreation
flags on the root context and (consequently) on any sub-objects objects created
when initializing deferred properties. Doing so otherwise will end up us
incorrectly linking QQmlContextData together, causing QQmlData::linkedContext
to point to iself and crash on exit upon deletion.

Task-number: QTBUG-37484
Change-Id: Ia5dc92a04e0f66499f15fbac10f14859d387b021
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix crash when calling concat on an empty array

Make sure to create the array data. The earlier called copyArrayData()
doesn't have to do that.

Task-number: QTBUG-37506
Change-Id: I6671769fcd471234c4c2eaa1614aa61266db0e5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Canvas: do not emit paint when resized but hidden

It turns out to be a bad idea (as in, breaks the enterprise controls)
to block paint() altogether when hidden. The original bug report
QTBUG-31830 only complained about paint() being emitted upon resize
while _hidden_, so this change solves exactly that. User is still
free to call requestPaint() even when hidden, and Canvas now doesn't
recklessly ignore the request.

Task-number: QTBUG-31830
Change-Id: Icd82188f65406b3ef6ae3b19b5984944576886ff
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Unset the current gl window when deleted

This does in the QSGGuiThreadRenderLoop what 403045a did for the
QSGThreadedRenderLoop. Fix a memory corruption in Mesa's dri2 EGL
when setting a window current after deleting the previous current
one.

Change-Id: I8df0bacdf12f71e969a9ea39842a402c9a2a303f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Add docs on using a query in XMLRole with the less obvious boolean()

Added to a documentation snippet since a direct boolean map is useful
in QML for toggles and using "@wanted/boolean()" as the @type example
does, would be wrong.

Change-Id: If412ec0f4891db39fe1a219f9cb89e1f7103fd38
Signed-off-by: David Greaves <david@dgreaves.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
qv4isel_moth.cpp: Fix MSVC-warnings about operator unary minus applied to unsigned.

compiler\qv4isel_moth.cpp(1041) : warning C4146: unary minus operator applied to  unsigned type, result still unsigned
compiler\qv4isel_moth.cpp(1056) : warning C4146: unary minus operator applied to  unsigned type, result still unsigned
compiler\qv4isel_moth.cpp(1096) : warning C4146: unary minus operator applied to  unsigned type, result still unsigned

Change-Id: Idb4714a277486ff736f49c50c7e840fd62e2150f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix context creation failure message.

Add missing newline, fix placeholders in translator's comment.

Change-Id: If80d237a97096a319a67da4c75c5e32c47576aee
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Suppress implicit sign conversion warnings in public API

Suppres implicit sign conversion warnings when compiling with the
-wsign-conversion flag.
E.g. “qqml.h:235:5: warning: implicit conversion changes signedness:
'const int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]”

Change-Id: I7a51c51609c39f2431acb95febed6bb741f3c09c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix AnimatedSprite interpolation when looping and/or reversing.

Ensure we interpolate in the correct direction, and that interpolation
occurs between loops.

Task-number: QTBUG-36339
Task-number: QTBUG-36340
Change-Id: Iccb097e6a9af9fa6697e2ba9ee852be9eb516edc
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>