Fix QQmlDelegateModel ignoring layoutChange in certain situations

Fix a regression introduced by commit a0aefe1 which caused the model to
ignore layout changes if d->m_adaptorModel.rootIndex was just a descendant
of any of the parent indexes, or when no parent indexes at all were provided
in the notification.

Task-number: QTBUG-39492
Change-Id: I4c97929d25ef75947ccfcbbe5bc234096689c58d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Delete objects created by qmlplugindump

This helps plugin objects to shut down cleanly

Change-Id: I167f63220a35a7428f50715a4cb9072320ef1c87
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
QQuickWindow: add some links to resetOpenGLState

... or people might not find it. So link it from the docs of the
various signals which expect the users to leave the GL state as
they found it.

Change-Id: I1ae41958449ded110aa2398b415d593bf04d2b7f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix QQmlDelegateModel getting out of sync

Fixes a regression introduced by a0aefe1, which caused that the
source data model and adaptorModel could sometimes get out of
sync.

Change-Id: Ia6b5fc380cc6cf6549ae857e6da54e088a5dadb5
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Merge remote-tracking branch 'origin/stable' into 5.3

Conflicts:
	tests/auto/quick/qquicklistview/tst_qquicklistview.cpp

Change-Id: I80584b4f7d62cd86d3449e19176118e3bed886c1
Fix assertion: ASSERT: "hasException" in file jsruntime/qv4engine.cpp, line 933

This was seemingly tripped by trying to catch the exception twice: once with
catchException and once with catchExceptionAsQmlError.

Change-Id: I7176d56fe6e6f748e80d0894e314ed2b8f6e751d
Done-by: Mikko Harju <mikko.harju@jollamobile.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
qmlplugindumper: do not pop up a window if an assert is triggered

On windows the debug version of qmlplugindumper used to show a panel on
assert failure. Failure should be silent.

Done-with: Thomas Hartmann <thomas.hartmann@digia.com>
Task-number: QTCREATORBUG-12644
Change-Id: Ib5036754b37cdd5e3820e0cfd60b3ef7df3f1fb6
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Use the current context to resolve extensions.

When updating the code to not use direct gl calls, this
code was changed to use the context's gl context. The
context doesn't have a context when the rendering happens
on the same thread as the scene graph rendering and
we get a crash.

Change-Id: I8adf62c0ed12bb055982a71ba59af76afeefcca1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Make canvas cleanup work propertly...

Depending on which mode we are in, we need to run cleanup
on the right thread and in the right way.

Image canvas doesn't contain any GL resources and can be nuked
right away. The actual QSGTexture is managed by the node, so we
don't need to worry about it.

For FBO it is a bit more complicated.
 - Threaded: We create a cleanup handler that runs makeCurrent
   deleteTexture and doneCurrent and then release the surface
   on the GUI thread.
 - Immediate: Same as threaded, just right away
 - Cooperative: Schedule the texture to be deleted on the
   next sync. The Context doesn't have its own GL context
   in this case, so don't worry about it.

Change-Id: I2d0ae7acfa05561faa52f3cacd767eb18cabaf02
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
More QQuickCanvas cleanup handling.

Avoid calling into QQuickContext2D from QQuickContext2DTexture
after QQuickContext2D has been deleted. We acheive this by

1. Giving the texture a direct pointer to the gl context and
   and surface, so that it doesn't need to go through m_context
   to get to them (which may have been deleted).

2. Protect access to QQuickContext2DTexture::m_context with
   a mutex and make sure it is set to 0 in a safe manner
   when the QQuickContext2D object is deleted.

Change-Id: Ie0a30f9fc46f844224838a7cdf2f28a62e8ce322
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Run autotests for Canvas.renderTarget == FramebufferObject also.

Change-Id: Id1729966b3b2b75a3bd4ad387b3d7914266fb3a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Merge branch '5.3' into dev

Conflicts:
	src/quick/items/context2d/qquickcontext2d.cpp
	src/quick/items/context2d/qquickcontext2dtexture.cpp

Change-Id: I1a9b911b3a92333a5dddbaf43275f71bad2006f0
Add declarative QQuickTextMetrics API from QQuickFontMetrics invokables

This allows use of a declarative API for the functions in QFontMetricsF
which take parameters. This solves the problem of QML expressions that
use QML methods not being re-evaluated when the internal data changes,
by allowing the user to set the arguments as properties of a
TextMetrics object, that would otherwise have to be passed to QML
methods.

For example:

    FontMetrics {
        id: fontMetrics
    }

    property rect r: fontMetrics.boundingRect("Blah")

At some point, the font of the FontMetrics object is changed, but r
will still represent the original bounding rect. Instead, the user will
now write:

    TextMetrics {
        id: textMetrics
        text: "Blah"
    }

    property rect r: textMetrics.boundingRect

The QML methods remain in QQuickFontMetrics for those who need an
imperative API.

[ChangeLog][QtQuick] Added QQuickTextMetrics, which provides a
declarative API for the functions in QFontMetricsF which take
arguments.

Change-Id: I019dc4639531906fc751ba61281cc1c695742287
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Add support for conditional breakpoints and evaluate.

Also centralized the context state saver and added line number saving, so that the
JS jobs for evaluation of breakpoint conditions don't change the state of the current
engine context.

Task-number: QTBUG-37119
Task-number: QTCREATORBUG-11516
Change-Id: Ia21b3d64e239e5b67f3c07e1c006d8e6748f29b6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4: add more line number information.

Change-Id: Ibd3e747918dc0bc939fcbd173585fb1e4d4f08fb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4: change string flattening to be iterative and use a worklist.

And not recursive, because that might blow out of stack space.

Task-number: QTBUG-39520
Change-Id: Id961d4af03a543d3efa173f976626cf2dae4f483
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4 IR: extend BasicBlockSet functionality.

To be used in later patches.

Change-Id: I379addaea225482bcbfd7a0b03dbdbaa254dd579
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Merge "Merge branch '5.3' into dev" into refs/staging/dev