Remove static initialization of QObjects

Statically initializing QObjects will cause e.g. the main
thread pointer in QCoreApplication to be set when the library
is loading. On Android, this is never the real main thread.
The effect was a warning about QApplication not being initialized
on main thread, and a race condition which sometimes caused
apps to hang on startup.

[ChangeLog][Android] Fixed possible hang on startup for Qt Quick
applications.

Task-number: QTBUG-36426
Change-Id: I7bd8a8f35ef1a2548949978563e3157f8dc854c7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Doc: note about visible and enabled in PropertyChanges

Change-Id: I0928737f1651fa98213a84dc4f8b5225d5239502
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Fix origin for short reversed item views

Reversed (BottomToTop and RightToLeft) item views would report an
impossible positive value for origin when contentHeight < height. The
correct value will be effectively equivalent to the position of the
footer, and always negative.

Match other logic using lastPosition() by negating its value for
reversed views.

This fixes a bug with content disappearing in a Controls ScrollView on
a BottomToTop view.

Change-Id: Ieedbb64ce8fc7c0fb36e5256e437ddeb3e757761
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Fix memory leak in test

Change-Id: I026ce85a6e593d5eccecdf032ee2f0763a2bef87
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Warn when attaching Keys to an invalid item

Using Window { Keys.onPressed: ... } does not work because window is not
a QQuickItem. Warn at least.

Change-Id: Ibd472f7b551ff2089cbc39ba43da27e6f8e0e97f
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Merge remote-tracking branch 'origin/release' into stable

Change-Id: I5ac68cc3ad3926190817f0d3d5b4526e70badff6
Expose Qt Quick gradient conversion code privately.

Rectangle is currently the only item that supports gradients, but other
items have been introduced (within Qt Quick Enterprise Controls) which
need QQuickGradient => QLinearGradient conversion, and it doesn't make
sense to duplicate the gradient stop conversion code.

The QQuickGradient and QQuickGradientStop classes need to be privately
exported so that modules that use private Qt API can use the classes
with quick-private.

Change-Id: I8b130ff5384d9481d3f29510b3de61f7d8f775e2
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Doc: Added information about classname in qmldir

QML modules that depend on C++ plugins must provide
the plugin class name information in their qmldir
to support statically built Qt Quick applications.

Task-number: QTBUG-35369
Change-Id: I15432fec4f8a72be4f851da061ac0c091696d8c9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Fix wrong calculation of viewPort for transitions

Viewport is calculated wrong for horizontal layout in a second instance

Task-number: QTBUG-29944
Task-Number: QTBUG-31546
Change-Id: I136ae4484278d14f796613505e3f38c65ec51ebe
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Florian Hänel <florian.haenel@basyskom.com>
Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable
Disable Flickable tests on Mac OS X.

Task-number: QTBUG-36804
Change-Id: I6bff9360d785bd7496131e3b56a24b11871257fe
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Enable program binary support through QSGRenderContext API.

Change-Id: I4eecff3c8a2c727d38d394305d248eddeef87e8e
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Provide scenegraph backend API for marking scenegraph nodes dirty.

Prior to Qt 5.2 tracking of dirty state was automatically handled by
QSGNode. With Qt 5.2 this approach has changed. Moving forward render
state is ideally tracked outside of QSGNode; however, we continue to
provide a way to track it in the node itself, to support custom renderers
and the default node updater.

Change-Id: I78907caee1b64b94a2bae2d8b577210f1955a431
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Update scenegraph docs to be in line with Qt 5.2 behavior changes.

Change-Id: Id21386e6dc85bb7e109d9bd03e80f306c0a99733
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Ensure m_opacityChange is cleared at the beginning of each frame.

Change-Id: Ic5eb5e1955e09884f98975a8ac74b42f00e233d7
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix crash when the currently running binding is deleted.

Stop capturing properties once the expression is deleted. The
following example triggers invalid read/write memcheck errors
when trying to capture propFromParentScope:

Item {
    property real testProp: {
        if (x == 0) testProp = 7
        return propFromParentScope
    }
}

Which can eventually lead to a crash.

Task-number: QTBUG-36798
Change-Id: I233de2c81498884df0563e8ce155752845aafcfb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix spurious binding loop errors in QtQuick Controls and other places

Commit 5dc7649f5ad7dca6e13707e827d001c3f118a6ef caused this regression,
as a result of lazy binding evaluation and self-referencing objects:

    import QtQml 2.0
    QtObject {
        property QtObject objectRef : subObject
        property QtObject blah: QtObject {
            id: subObject
            property int value: 42
            property int blah: objectRef.value
        }
    }

When blah is evaluated, we now lazily initialize objectRef - as opposed to
previously throwing an exception and then when objectRef gets initialized we
re-evaluate blah due to its dependency. So while evaluating "objectRef.value"
for blah, we initialize objectRef by evaluating "subObject", and after doing
that we write the "objectRef" property. That triggers a change notification,
and since the objectRef reference for blah is a compile-time known dependency,
the change notification triggers a re-evaluation of "blah", which is the
binding loop.

What's wrong here is that we register the pre-defined captures before the
code execution, when we should register them after the evaluation, or strictly
speaking after flushing pending bindings, like it is the case for individual
properties in bindings where we could not pre-determine the depenencies.

Change-Id: I9fb0c7583cba9d9b71c9ada2791fe87574f6ef44
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Revert "Fix scenegraph backend API for material shaders."

This reverts commit a8a90519cb35481e96fe8889846bfaa424e13e8a. The
same functionality is now available in a more extensible way via
the program binary support recently added.

Change-Id: I07b1939611a76858e65605ce625da6c4cbca2114
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Merge remote-tracking branch 'origin/release' into wip/tizen

Change-Id: Iaf609a5007ee6d02129cc63c0cf25bef1be7d99f