Avoid event propagation with Keys.forwardTo

[ChangeLog][QtQuick][Important Behavior Changes] Keys.forwardTo no
longer propagates key events to the target item's parents. This makes
Keys.forwardTo act more as expected, like an event filter. This way
Keys.forwardTo becomes usable for composite types that want to enable
the Keys attached property handling by forwarding key events from an
internal editor.

Task-number: QTBUG-37924
Change-Id: I66d1b7245df39678767e79d4bdd46fc15e5c5c3f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
V4 IR: only mark blocks after iterator calculation as loop blocks.

When the iterator calculation contains a condition, newly created
basic-blocks were marked as loop blocks. However, their parent was not
the loop header.

Task-number: QTBUG-38187
Change-Id: I9ee7a3e0bd536c2a005b91f8333931ce929245af
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix assignments of null strings in QML and JavaScript

Assigning "" to a string based property would exhibit inconsistent behavior:

  * When assigned as a literal, it would assign an empty string
  * When assigned from JavaScript, it would assign a null string

When the assignment was done _to_ a QByteArray property, it would hit
the case of calling QVariant::convert where the incoming variant is
either an empty or a null string and the target is a QByteArray. For historical
reasons - as documented - QVariant::convert will return false when the
incoming variant is a null variant.

In V8 assignment from JavaScript would produce an empty string and thus
hit the "succesfull" conversion code path in QVariant to convert to a
seemingly empty QByteArray. With v4 a null string would result in a failed
conversion and spurious warnings as seen in the reported task.

This patch ensures that we consistently map "" to a null string, when it comes
from JavaScript or QML as a literal string. We now also detect the situation of
trying to convert a (valid) null variant to another target type.

Task-number: QTBUG-37197
Change-Id: I68f9031262fdd287d69a38d5468fb38a20441d7b
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Disable mipmap filtering by default in texture materials.

15999f14f146b5c04fb40b31b69ceeeece273430 changed QSGPlainTexture so it
allows mipmap filtering by default. This requires a call to
glGenerateMipmap() for textures to be valid, if mipmap filtering is
used. Our texture materials follow the GL default which is to use the
somewhat useless GL_NEAREST_MIPMAP_NEAREST. As a result we've had a
number of bugs where textures are used and the call to
glGenerateMipmap() is omitted. This happens for instance when using
QQuickTexture::createTextureFromId().

Generating mipmaps by default is also a serious performance regression.

To remedy this and minimize the impact on existing code, we disable
mipmapping by default.

[ChangeLog][QtQuick][SceneGraph] QSGTextureMaterial and
QSGOpaqueTextureMaterial uses QSGTexture::None as default mipmap mode.

Task-number: QTBUG-38321
Change-Id: Ia9d09fbcf710efb4575938053d0a2046f604a197
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Regenerate mipmaps after changing the imagedata of a texture.

This has been a latent bug since the class was written, but has
only surfaced after 15999f14f146b5c04fb40b31b69ceeeece273430 when
mipmapping was allowed for all QSGPlainTextures.

Task-number: QTBUG-38321
Change-Id: I058e554c4035c573d2ddb4ea793d8ad53e11e54b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Stabilize tst_qqmlxmlhttprequest::stateChangeCallingContext() on Mac.

Fix fails:
tst_qqmlxmlhttprequest::stateChangeCallingContext() '(object->property("success").toBool() == true)' returned FALSE. ()

Debugging reveals that in most cases the function loadComponent()
is only called with parameter which=1; the call with parameter
which=0 never triggers.

Change-Id: I3c9c2f618d52c2bc8dd584a5fc3ab2f115715381
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Mark tst_qquicktextinput as insignificant on Mac OS X

This will allow further integrations until QTBUG-38363 is fixed.

Change-Id: I277628c55b893d199bd1886ee6eb9ff466860a05
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Doc: Improved Qt Quick Demos documentation

-added include from qtbase/doc/global about running the example.
-added link to "QML Applications" (main landing page for QML)
-highlighted the names with \e
-various documentation changes

Task-number: QTBUG-33597
Change-Id: I9e23b8b61862c424f2a17003b3d1f5b2ef931ceb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
V4: fix register usage on ARM.

JSC was using r3 as the address scratch register, which collides with
the 4th parameter in a function call. This sometimes shows up when
generateFunctionCall needs to do a calulated jump.

Also fix the usage of r11, which seems to be the fp on some platforms.

Change-Id: Ib2ea64b9342e5aa631db6a7641747f899b2fbd89
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Refine fix for dynamic properties on QObjects wrapped in JavaScript

This is an ammendment to commit 60730cbb5e5475b5db6a15641211aa6958a93197
to further restrict the ability to set dynamic properties on JS wrapped
QObjects only on those that are associated with a qml context. Only one
such association comes with the static property lookup rules of QML and
therefore only those should be prohibited from dynamic properties.

The previous implementation on using the "compiledData" field to detect QML
association or not is not strong and reliable enough.

Change-Id: I10c0e6e58a2727c01a6cb56fdf912bf250333e1f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Prevent a crash when the item is deleted but not removed from cache

If the item is not removed from the cache when it is deleted then the
cache can end up pointing to an invalid item which when accessed will
cause a crash.

Task-number: QTBUG-38430

[ChangeLog][QtQml] Prevent a crash when the item is deleted
but is not removed from the QQmlDelegateModel's cache.

Change-Id: I8cf76b014be62a432d909a3573231cec84a6d678
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Make sure the clipPath is retained as state of Context2D

The W3C spec doesn't say anything about the clip path getting reset
automatically at any point and so I guess we should retain it. This of
course is terribly annoying if the canvas element gets resized and ends
up with a default clipPath that doesn't match the canvas anymore. You
basically have to call reset() in every onPaint now. However, this just
highlights a general problem with stateful canvas contexts and we cannot
ignore user defined clipPaths like this.

Task-number: QTBUG-38297
Change-Id: I233226af6458298ef3d752d08ecdebebae2e0a8f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QQuickItemView/QQuickPathView: Fix creation of delegates

When the delegate is set before the model and
after the ItemView/PathView has been created

Task-number: QTBUG-38368
Change-Id: I6963abe28087699cf4e8921153dc7641bae3b220
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
qmlplugindump: correctly merge composite types

When hiding part of the hierarchy during the merging of composite
types properties/methods/signals that are hidden should not be dumped
twice.

Task-number: QTBUG-38354
Change-Id: I328cf25dd5a70e1c0fce017e8ae572e8a9e56245
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
If a popup window is opened, do not change the focus

It's not working to have QQuickWindow lose focus every time a menu is opened.
This doesn't happen on OSX because menus are implemented as special native
ones, but on X11 a menu is another window.  In QtQuick Controls it's
useful for copy/cut/paste Actions to be enabled based on whether
some text has focus.

Change-Id: I092b46133b9a8a44639ad9d89ee2bdfe30206bd9
Task-number: QTBUG-36292
Task-number: QTBUG-36332
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Implement the new inputmethod query API for Qt Quick

Part fixing Android input methods. This change corresponds
to 68a9229a97d358639 in the qtbase repository.

Task-number: QTBUG-37511
Change-Id: I483abf6a9d5dec86dbd1ae2dff2a85bc19d126f1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Make the Clocks example use the resource system

Make the Clocks example use the Qt resource system and the
shared main(), in order to have easy deployment to all
platforms and support for shadow builds.

Task-number: QTBUG-37203
Change-Id: Ia235b6b2397cfaeb20f0c7ea0d6196c603b20099
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Merge remote-tracking branch 'origin/release' into stable

Change-Id: I1214586499ab2876c8bc55a99367a0c938c8b919
Fix accessibility auto test

Prevent crash on platforms that don't support accessibility by skipping
tests.

Change-Id: Ie1648399d71546d222d6b37ce57f649b4cac303b
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Always implement text input "canPaste" property

This is needed for TextField control for instance.
If QT_NO_CLIPBOARD is defined, canPaste will always return false.
Fixes dialogs auto test when QT_NO_CLIPBOARD is defined.

[ChangeLog][QtQuick][Platform Specific Changes] Added canPaste
property to TextInput element also on platforms that don't support
a clipboard (QT_NO_CLIPBOARD is defined).

Change-Id: Ia85205672ba59c1fce70852458c514b03d332de6
Reviewed-by: Alan Alpert <aalpert@blackberry.com>