Fix FBO recreated every time the QSG node is updated under some conditions

When textureFollowsItemsSize is true and the item width/height are (1)
not precise integer values or (2) less than the minimum FBO
width/height, then QQuickFramebufferObject will delete and recreate the
FBO every time the QSG node is updated. This patch fixes the issue.

Task-number: QTBUG-40548
Change-Id: I532aaaa88a5c604ee7cc1fd8f0acb0601c5a94fb
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Synchronize PathView gesture grabbing with other items.

PathView didn't attempt to grab the gesture at the same event as other
items. This prevented PathView from rightfully claiming the gesture
before lower items in the stack. Use the same threshold test for
PathView as used elsewhere.

Task-number: QTBUG-37859
Change-Id: Ic57cb805ac979e41c3e35d86b2e7db781e61d69d
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Fix Qt.include with cached compilation units and resources

Similar to the worker scripts we also need to do a lookup for cached
scripts here. Added also a test to ensure that Qt.include works correctly
from Qt resources.

Change-Id: Idb67af3da4b0cc91edbd3d2746d074fd68ed8bf0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix fbo creation and resize logic in QQuickWidget

This corrects two issues:

1. Recreating the fbo twice when the widget is shown. Calling
createFramebufferObject() is not necessary in this case since createContext()
will trigger this anyhow due to scenegraphInitialized().

2. Avoid recreating the fbo when the size is the same as before. Some platforms
are keen on sending resize events with the same size. These should be ignored.
What's worse, some platforms (cocoa) generate a resize on exitting (Cmd-Q)
and not ignoring the resize at that stage is dangerous since the scenegraph
is already invalidated.

Task-number: QTBUG-40505
Change-Id: I21ff418fde449aa15eef4d6593e7a518861fcde1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Clarify Component.onCompleted/onDestruction docs

Change-Id: I86bb6b85043282f4f46a685e30b435a2f7430430
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Don't try to reload QQuick images when changing to null screen

When a QGuiApplication is destructing, a screen change occurs causing
QQuickImageBase to reload images ultimately resulting in "QPixmap: Must
construct a QGuiApplication before a QPixmap". This patch fixes the
issue (except for systems which multiple screens, which is a separate
issue).

Task-number: QTBUG-40539
Change-Id: I4bafc9790741204e90190a4491ac7a9393d0d0a7
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix crash when animators are deleted just after being started.

Change-Id: I35850e279dae596edb9a1b93143d6aa195221b41
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Fix crash when loading invalid QML with behavior on invalid group property

Behaviors require the creation of a meta-object. However when trying to
create a behavior on a non-existent group property, we don't have a
base meta-object to base the "new" meta-object on, therefore this patch
adds a null pointer check.

The error in the QML file itself will be caught later on. The added test
ensures that as well as that it doesn't crash of course.

Change-Id: If73116053464e7e69b02ef59e8387060835083c8
Task-number: QTBUG-40369
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Invalidate the scenegraph properly in the rendercontrol

Taking the persistent flags from the QQuickWindow was a bad idea. These
are not applicable to the case when an application drives the scene via
QQuickRenderControl. Once stop() is called, all resources must be
released since the context itself will typically be destroyed afterwards.

This is a backport of 0b0bb319578bb2e2eced3a80ce3876a4408b72a7 in dev.

On top of this, stop() becomes invalidate() since the original
invalidate() function is never used by anyone. This naming is much cleaner
and is consistent with QSGContext and friends.

Task-number: QTBUG-40505
Task-number: QTBUG-40435
Change-Id: I398f1bda31f335c3508b238f0328305d3cd79ffd
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Avoid double deletion when deleting an incubating component.

The guard in QQmlIncubatorPrivate::clear() was invalidated by clearing
the guards in QQmlIncubatorPrivate::incubate() when a deletion was
detected.

If we detect a deletion, leave the guards in place, to be handled in
QQmlIncubatorPrivate::clear().

Task-number: QTBUG-40685
Change-Id: I1bf7422fda97745f1f7a3b42285a399244c09a1f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Merge remote-tracking branch 'origin/5.3' into 5.4

Conflicts:
	src/qml/jsruntime/qv4include.cpp
	src/quick/items/qquickrendercontrol.cpp
	src/quick/items/qquickrendercontrol_p.h
	src/quickwidgets/qquickwidget.cpp

Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
V4 JIT: generate code for int32 comparisons.

Change-Id: I5e88fb3df7b01f4f515ce4d2e451a5a6f5ba92ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
Fix the nine patch node factory function (part 2)

Change-Id: I9edb6b0052d3b02cc412f56ae73e02652af0c93c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>