Documentation: Update QtQuick import value to 2.4

There are new APIs in Qt 5.4, the import version needed is 2.4.

Change-Id: I1c52c6a50362f539670d9ad00e03e57208234a17
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Add a debug function to save contents of distance field cache

Just copy the one from QSGSharedDistanceFieldCache with some
compile fixes to the superclass so we store the default cache
as well.

Change-Id: I1fcc390601eea58f8b7729c9cead418e4c94714c
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Mark cleanup function as unused if compiled with QT_QML_NO_DEBUGGER

The static cleanup function in qqmldebugserver.cpp is only used if the
debug server is actually created. If not we can mark it as unused to
avoid compile warnings. Enclosing it in #ifdef would be uglier.

Task-number: QTBUG-42394
Change-Id: Ieb7fa38ecb346e80ce815ced85eb3a168bad9d99
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Add attached Window::contentItem property

This is essential to the Qt Quick Controls for implementing floating
text selection handle popups.

Change-Id: Ibae65110a5db6d65dacd197fef3ad567d11342dc
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
qv4: assign split of edges to loop header to the correct group

(i.e assign split edges to the correct loop group, now for real)
The fix of 25b6fae1eb26645a30b3e7e254ce0b585757351c did try fix QTBUG-41766
and simplify the logic to assign the inserted statement to a loop group.
Unfortunately that was incorrect if the target basic block starts a group.
In that case if the source was already inside the group we should add it
to the target basic block, otherwise to the one containing the target
block (as before).
There was no visible regression caused by this.

Change-Id: Id50c42305fc5ac6aedaffa89d8f8dc3b5e976aa4
Task-number: QTBUG-41766
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Initialize member variable QSGAnimationDriver::m_lag.

Fixes purify warning:
[W] UMR: Uninitialized memory read in QSGAnimationDriver::advance(void) {1 occurrence}
QSGAnimationDriver::advance(void) [qtdeclarative\src\quick\scenegraph\qsgcontext.cpp:221]

Task-number: QTBUG-42213
Change-Id: Ide35830c60c5935644747da5cfbad1cdbd357232
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Stabilize tst_QQuickAccessible

There is no reason to wait for the window to activate

Task-number: QTBUG-42355
Change-Id: I5faaff5bddd367e6dd57a6a922011c87c847148e
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Avoid stack overflow when destroying InternalClass

If there are deep object hierarchies connected to an InternalClass the
recursive nature of the destroy() method could lead to a stack
overflow. By changing the recursion into an iteration this is avoided.

Change-Id: I6667f268a366749c2dbc5f7147882388f192a9c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Inspector: Do not assert when trying to stream QModelIndex

Some QVariant's like QModelIndex cannot be streamed in a meaningful way:
QDataType::save() will return false for them. However, this leads to a
qWarning and Q_ASSERT in QVariant::operator<<().

To prevent this we're calling QDataType::save() manually beforehand. We
however throw away the result if it succeeds, and still call
QVariant::operator<<() to get the benefits of the QDataStream version
handling.

The alternatives would be to make QVariant::operator<<() not assert,
or blacklist all known types with problems manually. Both seem to
be difficult though ...

Change-Id: I4f5fe6d5a3a076c24fbc73371a4d12d720de53da
Task-number: QTBUG-42438
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Debug: Make it possible to save distance field cache on Windows

This makes compilation possible of the saveTexture() function which is
used to store the distance field glyph cache on disk when debugging.
It also changes the warnings output from here to have no prefix, since
this is anyway always available as the context in Qt 5.

Change-Id: If3b64f0921a59c485b5321a5465369708e764afc
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
QQuickWindow autotest: verify that onClosing can block close()

Task-number: QTBUG-40093
Change-Id: I800259f45d95736172d500494e68042180178e93
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
QQuickWindow: let 'clearFocusObject' clear all the way to the root

The previous code was wrong, as it cleared focus from the active
focus item directly. By doing so we would only clear focus inside
the focus scope that surrounded the item, but leave the scope itself
with active focus (which would then be the focus object). The intended
result is rather to end up with the root as focus object.

Change-Id: I455a8939f8bc6c48765119b995aa781aee6d1e70
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
qmlscene: Simplify context sharing logic.

We can use the new application attribute for this now.

Change-Id: Ia0a6d13d36316ec9becfb5d3251b8461ac73a2d0
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix not having a context when cleaning up on Windows

The same old issue surfaces in the windows render loop too.
The basic render loop is already fixed, apply a similar patch
to the windows one too.

Task-number: QTBUG-42213
Change-Id: I07068315f5164014e329b8ce061947c97ae9da61
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Merge remote-tracking branch 'origin/5.4' into 5.4.0

Change-Id: I2c69deb3bc69da1a06485aaf72fb298b08756734
Merge "Merge remote-tracking branch 'origin/5.4' into 5.4.0" into refs/staging/5.4.0
Revert "Fix pixel bleed in BorderImage"

This reverts commit a9238292145e05d36be7c35bdd50829c6400a3de.

It also reverts follow-up commits:
  87755d0437413cfb875c50e3dfa53030601567c9
  c2c710e5a8d66fa696276aa69c2e3b00436eefe5
  cc8a76ce8ea76afe912902067e95ca2abf9e482f

The new implementation is much too slow because it will cause each
section of the border image to be uploaded to the atlas, and it will
not be shared between different border images nor between different
sizes of the border. The performance regression is so significant
that it's not worth it for the original bug fix.

We leave the tests around, so some of those might regress due to
this.

Change-Id: I3f56f4564255ebb77e6487881a6a11b19ad0234e
Task-number: QTBUG-42288
Task-number: QTBUG-35838
Reviewed-by: Michael Brasser <michael.brasser@live.com>
qml: obey QT_NO_REGULAREXPRESSION define

Not all platforms do have QRegularExpression as it is based on
pcre.

Change-Id: I3247f8b2213f78a6e537f6781d97b0c6382482ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Don't embded qmldbg_tcp plugin to libQt5Qml in static build

Embedding qmldbg_tcp sources to libQt5Qml causes multipled
definitions of QTcpServerConnection symbols with static
build on Qt Quick 2 applications. Qmake can resolve
dependencies to static plugins applications use, so no
need to embed this to libQt5Qml.

Change-Id: I18c5e44b9ac3de4ef8be29cc5944de3527566b3c
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
Add padding to distance field glyph cache

Linear filtering can cause pixels outside the glyph's bounding rect
to be sampled. On drivers where uninitialized texture data is actually
uninitialized, this could cause artifacts in rendering for glyphs at
the right edge of the initiliazed area since they would sometimes sample
random pixels. To avoid this, we add padding between the glyphs in the
cache.

[ChangeLog][Qt Quick] Fixed uncommon artifacts in rendering of distance
field glyphs.

Task-number: QTBUG-42148
Change-Id: I6982b4a150d9459185d50a4362e1ead588d3860f
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>