Fix crash with foreach on arguments object

We call fullyCreate() on the arguments object when it's initialized
on an foreach iterator. That itself however might trigger an allocation,
which in turn might collect the ForEachIteratorObject, which is missing
a "ProtectThis" in its constructor.

Change-Id: Ib8f7e39201e727cde91cbbe8a82cba78aa980f0d
Task-number: QTBUG-40844
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Move syncTimer measurment to the correct place.

syncTimer was including the time spent waiting for VSYNC on unchanged
frames. This was causing the reported value to be much higher than expected.

Task-number: QTBUG-40556
Change-Id: Ife759b4e27faf2124ab330be8d1f42d15c4d2d33
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Wait longer for image to be loaded in canvas item test

200ms can be too short if the system is busy

Change-Id: I4f9c6bcbec93d511b5b5e9d531450f3ffd22cb0c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Don't start QQmlThreads from their constructor

In the case of derived classes (like the only user of QQmlThread) we
cannot guarantee that the class is completely constructed when the
thread starts. This includes the vtable which is necessary to decide
which virtual functions to call.

Change-Id: Ieaea67a72cc3b4f845b8621b34ca2928185917fb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Make Canvas test case independent of chosen font.

0/0 is not always a red pixel after rendering "Hello" in red. The
chosen font has an influence on that. Looking for some red pixel in row
0 is pretty safe.

Change-Id: I669548c3c9d8cd25d720998fd9ba31c1f480e4e3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
QQuickTextControl: update cursor rect when cursor changes position

If the text cursor changes position by indirect manipulation of the
document that backs a QQuickTextControl, we need to inform that
the cursor rect changed as well.

This will fix a bug with QQuickTextEdit that caused the platform input
method to be out of sync since the cursor rect signal was never
emitted from the the text control.

Task-number: QTBUG-41042
Change-Id: Idcf35a2d51c8dffcb80ba21f8e59a61e04e5a879
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Fix crash when borders exceed item width/height in border image

While we protected against the the borders exceeding the size of
the source image when deciding whether to create a given patch,
we did not protect against the case where the target rectangle
is smaller than the borders. To fix this, we simply move the
calculation of the target rectangle up to before we create the
nodes, and check for isEmpty() before creating the nodes.

In addition, we did not properly handle changing the borders
dynamically. The subtree has to be rebuilt if the borders change
so that the source or target rectangles change.

Change-Id: Ia6a0df616ebbd0a32924de0b63fd48043027930a
Task-number: QTBUG-41338
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Fixed documentation for QQmlEngine::ObjectOwnership.

The ObjectOwnership enum's documentation mentioned that QObjects
returned from property access are indestructible, which they aren't.

Task-number: QTBUG-35426
Change-Id: Ic936b33b736ff7a45482cf1b626977d34ac4ebb2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Cleaned up the documentation for QQmlEngine::ObjectOwnership.

The paragraphs needed a bit of polish.

Change-Id: I5c6b41fad34f3f58a372aa1bf8be627769871cf8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix mapping of JS objects/arrays to C++

[ChangeLog][QtQml][Important Behavior Changes] When a JavaScript object/array
is passed to C++ through a QVariant, the engine no longer immediately converts
the object recursively into a QVariantMap or QVariantList but instead stores
a QJSValue in the QVariant. This prevents a loss of data when the JS object
contains non-primitive types such as function objects for example. Code that
expects the variant type to be exactly QVariant::Map or QVariant::List may
need to be adapted. Registered conversion functions however ensure that code
that merely calls toMap() or toList() continues to work.

Task-number: QTBUG-40431
Change-Id: I1dbc1d5f8e78ad28bb62db3681b9a0b34557e7f5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add a note about winId() to QQuickWidget

This unfortunate function causes the creation of a
native window which is very wrong.

Task-number: QTBUG-40765
Change-Id: Ia08138cf35c240c883c63a66a54f949b86ccc2d2
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Protect QQuickWindow::openglContext against not having a context.

Change-Id: I3d5087d9c322ee5ee3325858ee717161fd7801a3
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Don't assume a QSGRenderContext is valid just because it's not 0

Task-number: QTBUG-41353
Change-Id: I2a8c500ed974b3e5f45f3a1eb1f66c7a24b17d56
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
QQuickWindow::setColor() should use update() rather than dirtyItem()

dirtyItem() will trigger maybeUpdate in the renderloop which may
decide to skip the render pass if nothing changed in the scene
graph. Use update() instead which forces the rendering to go through
regardless.

Change-Id: I4730bb0cd79d58fa21970a847cc1720060cb14a8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Sync QQuickWindow::update() up with polishAndSync().

When calling QQuickWindow::update() on the GUI thread, we would
immediately flag the render thread that a repaint was needed and then
schedule a polishAndSync. If the render thread completed the current
frame before the GUI thread got to polishAndSync, it would repaint
right away without syncing with GUI first.

Instead of sending the repaint right away, register the need for a
full repaint in the window and set it as part of the next sync phase.

Change-Id: Ia731fb46724cc79f5391422213b069de9362d002
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix QQuickText::lineLaidOutRelayout autotest on OS X

QTextLine::height() can be different that QTextLine::rect().height()

Task-number: QTBUG-37829
Change-Id: I7fa93d50e29397237220ba111baa3bd1a56b88f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Finally: A default animation driver which doesn't use walltime.

I've wanted this for a long time, but the animation system didn't
support it when mixed with timers/pauses. However, because of
dfc8f8b5d4a02f33c7f9063c2a28450902a9d863 and
0db3ea4048fe572a256deb343ea5e64a55d98de9 to qtbase, it is now
possible.

Change-Id: Ic70c181ce49eae90276bd4f22a2d299061f96087
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Avoid crashing the rendercontrol example on exit

Task-number: QTBUG-41278
Change-Id: I456467698e66fb28f1bf6a05d85771ac25f454d0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Remove tst_dialogs - moved to qtquickcontrols

QtQuick.Dialogs were moved from qtdeclarative to qtquickcontrols
already in Qt 5.3, but the auto test was forgotten.

Change-Id: I5c74e45b9ee2302f1d20fb476af6a93879913a28
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Fixed frame focusing on touch devices

Also fixed the \quotefromfile commands in the doc to
display the changed code correctly.

Task-number: QTBUG-38779
Change-Id: I37d37139459cb9cdee7ec9beaffeab26a1cb4aaf
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>