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>
Doc: Updated the \brief and detailed description

Just to give a hint to the reader about what the
example does.

Task-number: QTBUG-37203
Change-Id: Ibb377e4adfb25ed4e4da0a41280e4157fae638ba
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Doc: Updated the QML State Machine docs

- Excluded the src/imports/statemachine directory from
qtquick.qdocconf to avoid unnecessary qdoc warnings.
- corrected a broken link to an external source
- changed the group name to avoid collision
- added a \qmlmodule page for QtQml.StateMachine
- Reduced the amount of duplication between the
C++ and QML state machine overviews.

Task-number: QTBUG-41561
Change-Id: I87c815fada7006f0609331e315bb338f062bb4db
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Make QQuickKeyNavigationAttached respect user set values

Before this change, when user tried to set KeyNavigation property
to the value which was previously automatically assigned, user set
flag wasn't raised. Such behavior led to situations, when explicitly
set values later were not respected by automatic mutual changes.

Change-Id: Id5ba5061c03a61f4d7835a638dc746b1485b9a56
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Export QQuickKeyNavigationAttached as a part of the private API

This change fixes linking problems when QQuickKeyNavigationAttached
is used through private headers.

Change-Id: I176a9551718d9ba25c160a3b1caa8872c88d39f3
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Return the content position rounded on the right side

QQuickFlickable::contentX/Y() returns the negative of the value
stored in the QQuickTimeLineValue used by QQuickFlickable.
So we must be careful when using things like qRound, and call it
with the negative of the value ine the QQuickTimeLineValue, else
code like this would fail:

QQuickFlickable *f = ...
f->setPixelAligned(true)
f->setContentY(-10.5)
assert(f->contentY() == qRound(-10.5)) // fail

The assert expression indeed turns into -11 == -10, which is false
but which is not what the user would expect.

Change-Id: Ib92ee2fa613b751462237349d9e4e2f2b4652f82
Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
Fix QQmlExpression/QQmlScriptString/QQmlBinding crashes

In the QQmlScriptString we store the binding id and it is an index into the
runtimeFunctions array of the compilation unit. However we don't store the
compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve
it from the cache via the context url (we have the context after all). That
turns out to be not a reliable way, as sometimes the URL might slightly differ
from the originally compiled cache (qrc:/// turning to qrc:/ maybe).
Consequently the type is (unnecessarily) compiled again and unfortunately not
_linked_, therefore the runtime functions array is empty. Another option is
that when the component was created from a QByteArray, then no entry exists in
the cache in the first place.

This patch addresses the problem by storing a reference to the compilation unit
in the QQmlContextData. That we can safely retrieve and it'll make sure the
compilation unit also stays alive.

In the process of that the manual reference counting was switched over to
QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit.

Task-number: QTBUG-41193
Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
PathView: Fix QML engine thinking currentItem is null when it's not

QML didn't re-evaluate any bindings using currentItem because a
notification was missing.

Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Stabilize and fix comparisons in animator tests.

compare() will compare properties of objects and neither Qt.rgba nor
image.pixel created objects has enumeratable properties so compare
is pretty much useless. Use verify + == which will rely on toString()
which is ok.

A few of the tests relied on execution order of signals emitted on
animation.running being changed and would occasionally fail.

Change-Id: I531c7f21b58a922a6be9ca2b6de120a68209a6d6
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Fix issues with Keyboard Focus documentation.

Change-Id: I0dcc364456404a761a555da065452a59d1249a2f
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Improve performance of animators.

The use of one QCoreApp::postEvent() per completed animation added up
to a very large overhead when 1000+ animators were used at the same
time. This is very relevant for sprite games and similar and deserves
to work at least as good as normal animations.

Instead, store the animations to stop and stop then on the gui thread
later as a result of frameSwapped. For the benchmark in question this
allows for roughly double the amount of animators being started and
stopped.

Change-Id: Iae3d1ec1502ee1908fdbba708fa9f976aa230064
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Correct KeyEvent::key documentation.

"text" is a property, not a function.

Change-Id: I02158d550ff174076396810dca007df1d734bda5
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
examples/quick/positioners: Colors changed and layout obeys screen resolution

Change-Id: I61b6358d6d5dff4cc9a14f8774b1c3597e83b550
Reviewed-by: Martin Smith <martin.smith@digia.com>
Merge remote-tracking branch 'origin/5.3' into 5.4

Conflicts:
	src/qml/jsruntime/qv4objectiterator.cpp
	src/qml/jsruntime/qv4objectiterator_p.h
	src/quick/scenegraph/qsgthreadedrenderloop.cpp

Change-Id: Ia54a9acd96530aa6683c228597af0ca25eadec4f
Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
Fix tst_qquickpositioners on OS X

Done-with: Jan Arve Sæther
Change-Id: Iff66f62167a5977354319aac311d2cb81d9f3842
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Make test more robust against ignored children.

With the upcoming change that changes the semantics of
Accessible.ignored, some assumptions in the test does not hold anymore.

Change-Id: I9b34f1ecc61fc0d4e8abe5a5505a5bcff44501d4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Tweak new animation driver.

We're removing the bad/reallyBad concept for the benefit of an
accumulated lag. When the lag passes over a certain threshold, we
switch to time based. The logic for switching back remains unchanged.

We also fixed the switching so that elapsed() does not jump from the
predicted time to the animation system's wall time, but rather
continues from the predicted time with a walltime offset (this is how
it was always intended to be).

Task-number: QTBUG-42020
Change-Id: I7ee9181aca46cbc18a74fae5e8d513365906c017
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
qmlstatemachine: Rename StateBase to State

As discussed with Brett Stottlmyer and Alan Alpert.

Add a section about the implications when importing both
QtQml.StateMachine
and QtQuick in one single QML file.

Change-Id: I8755f4b578e2a6ff4c2377c7a8a0b996ba9b7129
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>