Windows file dialog: Clean up thread manually.

Do not use deleteLater() to delete the thread.

Task-number: QTBUG-36357

Change-Id: Ie7c87b92a7c73d5fbac01d4951d387ee2facd05c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Fallback to QWidget::grab() if QScreen::grabWindow() fails.

QScreen::grabWindow() is not always reliable because it grabs from the
framebuffer. (The window might then be covered by other windows, e.g.
"Stays on top"-Windows, popups etc).
If QScreen::grabWindow() fails we therefore fallback to
QWidget::grab(). This will not grab from the frame buffer, but it will
ask the widget to render itself (with its current state) to a pixmap
and return it.
QWidget::grab() should usually return the expected pixmap, and the
pixmap it gives is not subject to the state of the window manager.

This means that both QScreen::grabWindow() *and* QWidget::grab()
must produce an unexpected pixmap in order for the test to fail.

Change-Id: I276554155bb1e5b510d2a2d43628d91669464fe2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Make QStringBuilder use our qt_from_latin1 code (out-of-line)

Disassembly shows that the compiler does not perform the zero-expansion
by itself. It always opts to copy byte-by-byte, which is not very
performant.

Change-Id: I08780902461d9e3e6b7b54298f41d1eca61339c4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Cocoa: Option handling.

Add qt_mac_resolveOption().

Support setting options using either an environment
variable or a QWindow property, with a default fallback
value. The options are resolved with precedence in
the mentioned order.

Adds options for the following:
NSView setWantsBestResolutionOPenGLSurface
NSVIew setWantsLayer
NSOpenGLContext NSOpenGLCPSurfaceOrder

The window properties use the _q_mac_camelCase format.
The environment variables use the QT_MAC_ALL_CAPS format.

Change-Id: I1978a02d62e107a2120d81ffdd0f7b32f7731644
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Compile.

Change-Id: Ib0e7e7aa2964835afda4055a5fe76abbd5db84e3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Support --option in addition to -option for all builtin Qt commandline options.

In addition to being more common and consistent with QCommandLineParser, this
will make it possible to add the documentation for these options
in the QCommandLineParser-generated help output.

[ChangeLog][General] Builtin command-line options such as -reverse,
-session, -style etc. now all support double dash, e.g. --reverse,
--session, --style...

Change-Id: Ia2e22c854ccc6a9d7b863b1234317005bc822191
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QWindow: reduce a bit of code duplication.

Makes it easier to add code in the future too.
No-op change.

Change-Id: I228c36813ccf8ee95ed4b6cbbc20af3178d1b84a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Windows: Refactor code registering/unregistering drop sites.

Only top level windows of certain types should be drop sites. Add code to
update drop site registration to setParent().

This ensures the drop site is unregistered for example when winId()
is invoked on a parentless widgets which is later inserted into a layout.

Task-number: QTBUG-33635

Change-Id: Ia3161ecd59753f3f39d2a5967e9cb922cf0b9203
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Windows: Post drag events for the window on which the drop site was registered.

Remove findDragOverWindow(); no longer try to find the window under cursor
since that would require synthesizing drag leave events. This is left to the
DnD handling of QWidgetWindow, which searches the child which accepts drops.

Task-number: QTBUG-33635

Change-Id: I844041bb862bb0382147be4e28f880a26843c453
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Automatically link printsupport plugins to static applications.

Add the required printsupport plugins to the QTPLUGIN variable
as is done for the QPA plugin.

[ChangeLog][QtPrintSupport] Made the Qt buildsystem automatically include the
necessary plugins so that static applications can print.

Task-number: QTBUG-29663
Change-Id: I0e2e3b0f25dd5714bd187711c85893926b0c4e85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
eglfs: Put Linux-specific includes within Q_OS_LINUX guards.

This should fix the build on platforms like the BSDs, where linux/fb.h does
not exist.

Change-Id: Ia06403d71c3aaa0e177c85dcefa7986647777ae0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix checking of category for printf-style qCDebug

Fixes an issue introduced in b8a38a6737a. We forgot
to check for category validness, and printed qCDebug(c, ""...)
unconditionally for compilers not supporting variadic
macros.

Change-Id: I779a97dacd7ea559f0d91473aad2c29e73ea2f89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>