Remove mouse grabber if touch used for mouse emulation has been grabbed

If an item grabs a touch that is currently being used for mouse pointer
emulation, the current mouse grabber should lose the mouse as mouse
events will no longer be generated from that touch point.

Example of what happens without this patch:
-User touches a MouseArea. It gets pressed.
-Some other item grabs that touch.
-This touch eventually ends.
-The MouseArea would still be pressed.
And what will happens instead after this patch:
-User touches a MouseArea. It gets pressed.
-Some other item grabs that touch.
-The MouseArea gets canceled and released
-This touch eventually ends.

Change-Id: I24114f18be564553a4a768243bb20379affe7a8f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Repeater & itemviews: fix setModel() JS array handling

QVariant comparison in setModel() started failing because
JS arrays are now passed as a QJSValue. Re-assigning the
same array content should not trigger a model change.

This change restores the old behavior it had before, when
JS arrays were passed as QVariantLists.

Change-Id: I1882b3531f2893b116dbd817edeecab1ae812ce8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
text input: always let cursor rect have a width == 1

Instead of using a cursor width of null when a cursor
delegate is set, we should to use a value of 1.
Otherwise the rect we e.g return from cursorRect() will
be invalid. An alternative would be to use the width of
the delegate, but that was found to be controversial.

On iOS we saw a bug with this when telling iOS to position
text spelling popups underneath the cursor. Since the
cursor rect we got was invalid (zero-width), no popup
would show.

Change-Id: Ice51b9a1bd33f331183e3acec61b7d9c0f5163cd
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Fix Canvas documentation.

getContext documentation wasn't showing up due to a syntax error:

"any ..."

Also fixed some small issues here and there.

Change-Id: I3c0444d25bd0fea72fb4fcbf07b3e00794ff1414
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Fix ICC-on-Mac warning about unknown #pragma

qqml.h(506): warning #161: unrecognized #pragma

Change-Id: I089007db4c4d0701eff32ce0b1c2fff1f65d5c48
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
BorderImage: Fix white area when size changes after first paint

When e.g. growing the size of the border image in an animation,
we would not get updates of the paint nodes when the size was
so small that the bounded target rect and source rect did not
change (when the size was smaller than the sum of the borders).
Since this can happen, we also need to detect when the size
changes and update the node for this case.

Task-number: QTBUG-42022
Change-Id: I0849d740f363e66a3a4fd6de23fc9d7399ab0779
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Don't allocate less memory than required

When switching from a simple to a sparse array,
keep the previously allocated size, to not corrupt
memory.

Change-Id: I33f0fb049a2ad6f24ee3703f2c333855830fe9d2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Get rid of !this and similar constructs

The C++ standard doesn't allow calling member functions
on a mull object. Fix all such places, by moving the checks
to the caller where required.

Change-Id: I10fb22acaf0324d8ffd3a6d8e19152e5d32f56bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: I30f9c925631991ceb22339d1333936faecffbaf4