Expose screen change event to widgets so that they can check the dpr

Unlike ordinary widgets, the ones that have OpenGL framebuffers must know
about screen changes because the device pixel ratio may be different on
the new screen. Add an internal event, ScreenChangeInternal, as the
counterpart to WindowChangeInternal.

Change-Id: I5e55999838e4c0284e7d9832299f7cc6b541ee3f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Update QOpenGLWidget paintDevice devicePixelRatio when recreating fbo

The QOpenGLWidget's paintDevice needs to update devicePixelRatio when
changing screens.

Change-Id: Iec6e7157f22ff99e04f81347cbbf70f3fc3ff424
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QRegion: remove some toplevel const from return types

It has no effect and inhibits move semantics.

After this change, two and five more copies are moves in QtGui
and QtWidgets, resp.

Keep the old form for compilers that mangle the return type.

Change-Id: I6257683144110230079fe9095303907ecc858c94
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Android: fix inputmethod race conditions

focusObjectInputMethodQuery() and sendInputMethodEvent() were not
thread safe. Remove them, and replace with thread safe versions
based on the same principle as queryFocusObjectThreadSafe().

Task-number: QTBUG-40995
Change-Id: Idb6f0c6d3963b7e8e73e029e83d0367088146ca8
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Fix bugs in internal comparison operators

The comparison operators between QJsonPrivate::String
and QJsonPrivate::Latin1String weren't all correct, leading
to wrong sorting of keys in QJsonObjects when the keys were
outside of the latin1 range and resulting lookup errors.

Task-number: QTBUG-41100
Change-Id: Idceff615f85d7ab874ad2a8e4a6c1ce8c2aa0f65
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Don't accept json strings with trailing garbage

A well formed JSON document is not allowed to contain
trailing garbage at the end. Don't accept this in the
parser.

Task-number: QTBUG-40062
Change-Id: I0a09dbd099a8c643f58023342546c4e67d026fec
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Fix user defined conversions to numeric types

The old code was completely broken. It did dereference
val for user types, but val does in this case only contain
garbage. Instead use the pointer to the correct data.

Change-Id: I20ccf0bfa3dd3774c787d08c51cc8dd7b1ec9a1a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Fix several issues in QCollator

Refactor the code and move more things into the cross platform
code path.

Make sure the flags survive changing the locale of QCollator.
Use the correct locale on Windows, WinRT and OS X. We now
pass all QCollator autotests on these platforms.

Task-number: QTBUG-40778
Change-Id: Ic2d3334b5018c323a35a3ea8fc1d7ab5f99b4e62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Mark the remaining QGL classes as obsolete

Many of them are already marked. Do it for the rest (QGLWidget et al).

Change-Id: I506d72ad20f8ef39981dbeee0df49229bcf748a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QLockFile: on Windows, retry deleting the lock file if it is being read.

A "sharing violation" happens when trying to delete the lock file and another
thread/process is reading it at that very moment. Detect the error and try again,
up to 10000 times - to avoid an infinite loop if QFile::remove fails for another
reason such as a sudden change of permissions preventing us from deleting our
own lock file.

On Unix the deletion can't fail because of readers, but it doesn't hurt
to check the return value there too, to catch other reasons for failures
such as a sudden permission change.

Task-number: QTBUG-38853
Change-Id: Icf12a74faed4a4916e3427abc09d9c33aa141476
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Revert "Reading QJsonObject property should not modify the object itself."

This reverts commit 20cf632ad5f3ffe7b0fd231724c971f4e07304eb. The commit
produced to many problems during statics destruction. For example
causing QtCreator crash (QTBUG-40987).

Change-Id: Ib52f6a449c2d84deab2de792559a6a065ca45e8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Doc: Sync qtcreator.qdoc.

A topic URL has changed in the Qt Creator documentation.

Change-Id: I3c6b5fbcb670d7a637a309b7a77a3da815a795ca
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Use a dedicated timer for the animation driver.

QUnifiedTimer::elapsed() was implemented using
driverStartTime + time.elapsed() while the driver
was running, but time.elapsed already contains
driverStartTime so that was counted twice. This caused
repeating timers to fire immediately once they first
had fired, if the animation driver was started while
it was running.

Separate the two timers. Animation driver time restarts
from 0 every time it starts.

Change-Id: Icf5cd0381b121b2355d7c6ec3edd0997721cbcdf
Task-number: QTBUG-41198
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Doc: corrected link/autolink errors in corelib/doc/src

Task-number: QTBUG-40362
Change-Id: I0ff1523c76724e0662bafed08515ea06bbdd8381
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>