Added explicit threading API to QtOpenGL.

Since QtOpenGL/QGLContext is implemented in terms of
QtGui/QOpenGLContext which has stricter requirements about how it's
supposed to be used, we need to apply these requirements to QGLContext
as well.

This change adds QGLContext::moveToThread(QThread *) and documents it as
a necessity for making a context current on another thread.

Also introduces QGLPixelbuffer::context() to access the QGLContext of a
pixelbuffer, and made QGLWidget::context() return a non-const
QGLContext, since there's no good reason why it shouldn't, and it leads
to less const_cast clutter.

We could have introduced a backdoor in QOpenGLContext instead, making it
loosen its requirements, but that would have made it harder / impossible
to fully support threaded OpenGL in all the platforms.

Task-number: QTBUG-22560
Change-Id: Ibb6f65f342e7c963e80cc42ab5664c5f1cab30b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Restore the visibility of a moved QWindow in QWindow::screenDestroyed

QWindow::screenDestroyed triggers an move of the window to the primary
screen. This causes the screen to be destroyed and shown again on the
new QScreen.

The issue is that QWindow::destroy() hides the window but create()
doesn't set it visible, and this ultimately causes any QWindow to be
automatically hidden when their QScreen is destroyed.

As stated in the comment, it could be the intended behavior that
windows aren't shown automatically on a remaining screen like when
using two screens not logically part of the same desktop. Once the
platform plugins have access to an API allowing them to adjust the
screens of their QWindow, this patch shouldn't be needed anymore.

Change-Id: I7628377c969f79f9eebb3deabaf0470542d68a9c
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
QPA: update backingstore also when moving QWindows

When moving QMdiSubWindows that contains native widgets (e.g QGLWidget)
inside a QMdiArea, garbage is drawn to the screen. The reason is
that since we use native QWindow backed widgets, QPA will assume
that it does not need to update/scroll the backingstore. But since the
backingstore can be shared among several windows, we need to do this to
ensure that exposed areas behind the moved QWindow will be updated.

Change-Id: I35f4d4069a73ab6cd6d610e25c176c752789a927
Task-number: QTBUG-26162
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Fix path to style/offline.css in qt-module-defaults.qdocconf

Change-Id: I203cca8041c44116bef7021837ad21bd85e86b4c
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Fix docs for Drag and Drop examples

Change-Id: Ic1622b64603f7634b697bd7d8412dcc9f1a8c3fa
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Remove reference to Qt 3 documentation from example qdoc code.

Change-Id: I0999b24f12ee4c878fc2a95b171474eea7a55ba5
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
make minimalegl plugin compile without QtWidgets

Change-Id: I060ea584dd78e5f389010ab007567aed11793c23
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Doc: Removing entry in CSS for adding icons to HTTP links

This is a temporary solution to
QDoc bug https://bugreports.qt-project.org/browse/QTBUG-28307

The links will not have the icon.

Change-Id: Ib81bcc9c55cd5f403c85fdd38c0ee71219091e76
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Fix path in qtxml.qdoconf

../../../examples/xml/src
doesn't exist, it is
../../../examples/xml/doc/src

Change-Id: I08f0d6d91b2cea7bf313cbcdd50632835e21ae24
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Add few missing entries to the changelog related to QObject and moc

Change-Id: I96fa72f1a0669f0899e8079b214cac54e5d6edef
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Docs: fix code snippet paths in xml-processing.qdoc

Configuration file's exampledirs variable already contains the
xml sub directory, snippet paths are relative to that

Change-Id: I627aebade224afdb7bd38f2b1a089a747e49fabf
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
doc: Add touch input examples to correct group

Make them appear in list of touch input examples.

Change-Id: Ia5f489e28771f0a272da9ec7b61de186ca305e36
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Add a way to not generate INCLUDE_DIRS variables.

ActiveQt needs this, and it sets the no_module_headers flag.

We still need to set the include_dirs variable in the
no_module_headers case, so that its dependencies are added to it.

Change-Id: I2cad5ee792eed51d36b7c8e2c616763516a5fc10
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Made QWindowsStyle internal

We will take this opportunity to remove various QStyle specializations
from the public API in Qt5. This gives us much more freedom, for
example changing the inheritance hierarchy, pluginizing etc. without
worrying about BC.

=> Use QStyleFactory and/or QProxyStyle instead of creating an instance
or inheriting QWindowsStyle directly.

Change-Id: Ic17c7e425535bc5bb3a08620e9059bb0aea5185e
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Docs: clarify availability & platform theme usage in widget galleries

Change-Id: Id3c1e278d6a6ce6c67b7f73c3a9490cf83eb0466
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
QGV: set QStyleOption::styleObject for graphics items & widgets

Certain QStyle code paths expect the style object to be set. This will
avoid problems when QGraphicsItems/Widgets utilize QStyle for drawing.
Even if things will not necessarily animate properly, such legacy code
won't cause a crash at least.

Change-Id: Ic77cb4ee9820d6c4ec92c7278fd87cb866f5a780
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Fix linking in painting, richtext and desktop examples

Change-Id: If08b2c3366610f74201ab6736f216f1a7d29b3c7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Fix broken links in the QtWidgets examples.

I remove the widgets examples from the gui docs as they will
introduce broken duplicates (under doc/qtgui/...).

Change-Id: I54255ceaf4187477da3e82f6809be41fb98378a2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Docs: revise QApplication snippets

Change-Id: Ibbd31736154af6dd009d331578f9addc4de76e89
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
don't install headers into Qt/ any more

this should have been part of 656e0d342.

Change-Id: I56e5d743a756e9236759595429de85754593638e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>