Set a size in qopenglwindow example

Use showMaximized(). Just calling show() without setting a size can result
in a zero-sized, invisible window on some platforms.

Change-Id: Ifa48258060e3d651c2fac3a1409a26a2c3db6bdb
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Fix composition for translucent AlwaysStackOnTop widgets

Writing out the alpha is re-enabled too early. When blitting the
AlwaysStackOnTop widgets as the last step of the composition, they
need the exact same settings as the backingstore content, meaning
blending but without writing out alpha.

Move the glColorMask call to fix this. This will avoid issues with
semi-transparent AlwaysStackOnTop widgets when the top-level has
alpha enabled too.

Task-number: QTBUG-40910
Change-Id: Id6d0d684cfa78bf79b65a097efd92de575e73b2c
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Add operator-> to QJson iterators

The iterators for QJsonArray and QJsonObject are currently lacking an
operator-> definition. Unfortunately it is not possible to do in clean
way without redefining either the iterators or QJsonValueRef class.

This patch instead adds two fake pointer classes that are only used
to handle the operator-> return value.

Task-number: QTBUG-29573
Change-Id: Ief785a6afbbedc9e89cf3b6f3958c2c755997a66
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
OS X: Fix pan gestures.

The QPanGesture recognizer requires single-point touch events. The touch
implementation in Qt 4 would test Qt::WA_TouchPadAcceptSingleTouchEvents
and forward single touch events if set.

Making this work in Qt 5 is a little bit more involved since the platform
plugins don't know about widgets.

Change the Cocoa touch implementation to send single-point touch events
to QWidgetWindow windows only. Make QApplication forward single-point
touch events only if the target widget has the
Qt::WA_TouchPadAcceptSingleTouchEvents attribute set.

Task-number: QTBUG-35893
Change-Id: I68712a5e3efb4ece7a81ca42f49c412e525eeb3a
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
DirectFB Add QGenericUnixServices and inputContext

The DirectFB platform plugin was missing support for services and
inputContext.

Change-Id: I010fdcbed5e172b019b4dce79f3beea0f9c5025d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
DirectFB Provide a native interface

Using the same multiple inheiritance that is used in the EGLFS platform
plugin.

Change-Id: I016f904bfc365bec6266c3f5d638ab15ecefe63b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
DirectFB Make usable again with QWidget

Previously when we created any QWidget based application a
QDesktopWidget would be created as a physical window like any other, but
this window would steal input from the application.  We now create a
DirectFB window for the Qt::Desktop type of widget now, but it does not
receive input events and can not be painted to or displayed.

Change-Id: I6a090c5384b1f83383e40680dbede5d0edc41983
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
DirectFB Unbreak mouse input for child windows

The local and global coordinates for mouse events were being translated
incorrectly from the native DirectFB events.

Change-Id: Id904a4335459b87c92f4b8b46d535c78fb7dad8c
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
DirectFB Fix issue with showing dialogs

If the window was not visible when the geometry was set, then the
DirectFB window would not be resized.

Change-Id: I7790c90ed0fb755aebee0e32c877ebd9e48417cd
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Initialize textureId in platform backing store

Setting it initially to 0 is very important, otherwise we will
do a glDeleteTextures with the undefined value.

The result sometimes goes unnoticed and sometimes causes bizarre
issues: For example in the 'textures' example one face of one cube
out of the six did go blank from time to time since the corresponding
texture was deleted by the backingstore.

Change-Id: Id19eb2164471b542b08a277a65edfcb5d0f8248d
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
OS X QColorDialog: emit reject() when closed by the titlebar button

but only if there is a Cancel button.  A color dialog without a cancel
button might be kept open and apply to various selections, so it
doesn't make sense to reject such a dialog, only to close it.

Task-number: QTBUG-40855
Change-Id: Ifffb4ae81307c72259ed388a4776ba09543603e7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
QColorDialog manual test improvements

Show debug output for rejected and currentColorChanged signals,
because accepting is not the only scenario to be tested.

Task-number: QTBUG-40855
Change-Id: If741ab19392e7d4314e0eff82a939d202ae86b48
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Use QMenuBar::addMenu in the qopenglwidget example

Like in all other places. This way the resulting QMenu is correctly
parented so it will show up at the proper position even on platforms
which do not have a way to position top-level windows.

Task-number: QTBUG-29025
Change-Id: I2aa6fe73699379029c44a3f379366a2133753190
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Support QOpenGLWidget and QQuickWidget on Android

It gets somewhat complicated due to the fact that a RasterGLSurface window
(i.e. any widget window since 5.3) may behave either like an OpenGLSurface
or a RasterSurface, and the expected behavior may change on each backingstore
sync.

This does not fit designs where the platform window implementation is separated
and there is different behavior for raster and GL windows.

Therefore QAndroidPlatformOpenGLWindow is now made capable of behaving like the
raster one, based on a flag communicated from the widget stack via QWindowPrivate
(since the plugin knows nothing about widgets).

This means that widget windows that do not have renderToTexture children (QOpenGLWidget,
QQuickWidget) will go through the raster path, while the ones that have will behave
like an OpenGL window with the actual rendering happening in
QPlatformBackingStore::composeAndFlush().
The surface type is RasterGLSurface in both cases nonetheless.

Task-number: QTBUG-37907
Change-Id: I6f9261fc0fd993afcda7f30d379c5410069033d3
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
QOpenGLTextureBlitter: Do not call vao functions if it failed to create

Follow the good practice of checking for isCreated() before calling
VAO functions like bind(). Use also the vao binder where applicable.

Change-Id: Ib827f3bce838396bf2e08f9480fa63801d4d3a50
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Avoid crash if querying device that has gone away

A device removed very fast after being inserted might disappear while
we are still seting it up. We must therefore check if we indeed still
get a matching device

Task-number: QTBUG-40820
Change-Id: I4372fb1932264e5799f37cea0d016795e28ebed6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
QEvent check for QT_NO_GESTURES in new debug code.

Latest changes to QEvent break compiling with -no-feature-gestures.

Change-Id: Ibbddd73a4f567051c3793a7aaf438240add6583a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>