Add some error handling to the QWindowContainer example.

Use a QMainWindow and display errors occurring during loading
QML as well as scene graph errors (for example, failure
to create an Open GL context) in the status bar.

Change-Id: Id9cf190e8a4f40de0f18ab081e2747135221bb88
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix MSVC2012 compiler warnings.

Tested on both win32 and win64.

Change-Id: I47755e2da51829e61e1452eaaf84a057224b478b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix qquickfolderlistmodel test compilation on WinRT

Like WinCE, the changeDrive() test should be disabled on WinRT.

Change-Id: I85749b84fef372e166fe52c263225478094ccdb4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
[new compiler] Fix invalid memory reads when JS closures outlive QML types

If QQmlCompiledData gets destroyed while somebody still has refcount on the
QV4::CompiledData::CompilationUnit, then unit's _data_ would be freed already
by ~QQmlCompiledData. Given that compilationUnit->data is pointing to the same
malloc'ed address as QQmlCompiledData::qmlUnit, we can just let the
CompilationUnit always own the data.

Fixes tst_qquickloader and makes it possible to run the qquickcomponent tests.

Change-Id: Ie3f3e5335139236d7c2524a327665bda0a9cc847
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Add support for deferred properties

Change-Id: I592518444ef353cfcf153df0e6afa2fbac613560
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix auto component creation with composite types

A binding like this

    property Component foo: SomeComposite {}

should not do an implicit component insertion if SomeComposite is actually
a component. The property assignment is compatible and can proceed normally.
Fixes tst_qquickcanvasitem, but added a separate unit test for this case.

Change-Id: I7221eebd38dba3f2a82b59341739b9b67211e352
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Make tst_qqmlincubator::chainedAsynchronousIfNested more robust

Don't rely on the exact number of instructions executed in the VME to
determine the loading state of the incubator. With the simpler object
creator that's not based on instructions we might end up creating objects
in less steps, so make the test work with both.

Change-Id: If8a3628cac97251036c9b2cd8f26e75eca1d39ed
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix designer integration

If the QML puppet disables onComplete callbacks, we must obey that also
in the new code path.

Change-Id: Ic9b74c6a5ee04dc5b8e4f545a8e6cc0fa8dd28f1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add some leading white space to generated code for QML signals.

Like this the column numbers in the generated code are correct. We rely
on the column numbers in quite a few places.

The alternative solution of extending the Javascript parser to add an
initial column offset would result in much more code and complexity.

const-casting the column number and adding to it after compiling would
be an option but as the column number may be saved in other places, too,
this is not desirable.

Task-number: QTBUG-37226
Change-Id: I0d11816d96ff4e7c756064646755a3e9874f9790
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reset the expose cycle when polishAndSync aborts.

On platforms with misbehaving expose behavior, we will get
and exposure, even though the window is not renderable.
This results in the renderthread being in the "wait for polish"
state while the GUI thread goes back to "no state". Check
for this and reset render thread's expose cycle when it
is hit.

Task-number: QTBUG-37201

Change-Id: I6a6c89d9016301ff19443f88a2c182012b4eb65f
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Fix GridView flow enum docs

Task-number: QTBUG-37232
Change-Id: Ib975181e6cff9a86f642d822dfc92773528598cb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Stabilize tst_QQuickPathView:dataModel()

- QQuickPathView::setCurrentIndex() result must be immediate
  => no need for random QTest::qWait(100) there.
- Remove another random QTest::qWait(100) after inserting
  a model item. Instead, wait for the desired result ie.
  delegate creation with QTRY_VERIFY().
- Furthermore, disable the default highlight move duration to
  avoid the auto test and QQuickPathView's internal timeline
  fighting over the current index.

Task-number: QTBUG-35705
Change-Id: Ie53fdcc8f7955a03027da38b075e6042a3aea7f2
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Doc: Fix "Right-to-left User Interfaces"

* Change from QApplication to QGuiApplication
* Change from qmlviewer to qmlscene

Change-Id: I6ceee763c125c4896905884f55437e3f375408d7
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
[new compiler] Fix incorrect accelerated lookups to id objects

When compiling JS code in the scope of a component, make sure to always
set the id object mapping, even if it is empty. Otherwise the id objects
from one scope might leak into another, leading to id object dependencies
that are invalid.

Change-Id: Ib2bca11203acd6924e8c74f9560a1ee3e00d7e39
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix potential infinite recursion when using the incubator

Some auto-tests use the incubation controller with a one-step boolean,
so shouldInterrupt() always returns true. When we're in the finalization phase
enabling the bindings one-by-one, pop one off the bindings stack and enable it
_before_ doing the shouldInterrupt() check. Otherwise we don't progress at all.

Change-Id: Ibd5bbc253f8e8f74b08c91b018533c9e2735d2c8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix crash in tst_qquickpathview

QQuickPathView's attached object uses a dynamic meta-object. So when installing
bindings - such as a signal handler - on it and we want to determine the
property cache for it, we must not use the QQmlEnginePrivate::cache overload
that takes a QObject pointer, as that will - rightly so - return a null
pointer. Instead in this case it is okay to go with the static type overload,
by using the meta-object of the attached type known at compile time.  This is
consistent with the VME code path.

Change-Id: Iffc64f7ee4677c6cc60d071b80f4032cf8037ab7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Switch the code path from the old compiler and VME to the new code path

Change-Id: Ib1b38ec07830f8df9fa4caacd00879434608053b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QSGBatchRenderer: return when a shader is not returned by the manager

If a shader can't be found from the manager (e.g., if it failed to link),
return from rendering. This prevents the renderer from crashing on a
null pointer.

Task-number: QTBUG-37290
Change-Id: I44d0bbb721854c0bc6da681ff55f71140a5cb0bc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix a couple of typos in the documentation

Change-Id: Ie06af2e33e5adf6d56391929bd763b01e57557b0
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>