Fix for co-existence of QtDeclarative and QtQml

As a follow-up to commit 2f87fde9bb4bad6787101c0d135419b350b201a5, we also need
to change "hack" in the QGraphicsItem and QWidget destructor for early item
destruction to support the _qml1 variant of the QObject destroyed callback.

Task-number: QTBUG-35006

Change-Id: I65e37b1e9ddd8d14267aaba024408611b8cd3d77
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Android: Remove invalid error message

All usage of context menus prints out an error message because
onContextMenuClosed() is called more than once. We just return
silently instead if the method is called after the menu has
already been closed.

Change-Id: Ifa27ed42d188fdf670f09c4b1450b9fec0d5941f
Reviewed-by: BogDan Vatra <bogdan@kde.org>
CoreWLan: Fix potential unhandled exception assert

-[QNSListener notificationHandler:] was declared as not taking any parameter,
but used as taking a single NSNotification. This would lead to an 'unrecognized
selector' exception raised by Cocoa.

Task-number: QTBUG-26844
Change-Id: I56d03a7738c2a1b9dcf3cdecc696b01e65d7b233
Reviewed-by: Liang Qi <liang.qi@digia.com>
QPrintDialog - Fix casting print engine

We want to cast the print engine, not the paint engine.

Change-Id: Ia8f11f0215fa066417118fbfbcc921a60282d713
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
QPrinterInfo - Fix isNull() by fixing constructors

The QPrinterInfo copy and QPrinter constructors and the assignment
operator were not taking the shared_null into account, and so any use
of them resulted in a new null QPrinterInfo different to shared_null,
which lead to isNull() always returning true in anything other than
the simplest use case. While fixing this also make the shared_null a
Q_GLOBAL_STATIC.

Task-number: QTBUG-21087

Change-Id: I0beb24088208e9ed58d21ca26b0c8d00b02e5b8f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
QCoreApplication: Add static setter for application file path.

In cases where QGuiApplication is instantiated by a library
embedded into another application via some plugin mechanism
(for example, Active X controls built using Qt), the QPA platform plugin
and other plugins cannot be found next to the application executable.
In this case, the library should set the application file path to
its deployment location such that plugin paths are set accordingly,
the directory is added to the path and qt.conf is found, should it exist.

Task-number: QTBUG-34989

Change-Id: I4a53104b5121a8d26751129912f999228be45dfd
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Fix test compilation on WinRT

Tweak a handful of tests which didn't compile on this platform.

Change-Id: I208d9eb289dfb226746c6d0163c3ea752485033b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Remove leading '/' from target paths.

This is inappropriate on Windows, and breaks non-prefix builds there.

This is only needed when we calculate a relative path from a sysroot,
so only add it in that case.

Task-number: QTBUG-34880
Change-Id: I0e3b3d977a7b56649e4ba0077ac574aabf1dc915
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
QNX: Fix retrieving the window group name

The code assumes that there is a root window, and crashed
otherwise.

Task-number: QTBUG-35121
Change-Id: Idbf0e0bfc03cd427f0aab81db88b34fe94228c81
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Revert "Store the font's scalability in QFontEngine."

This reverts commit 65b12fbdb13d34c61bcadd5cc8fd6ee28a8dfafd.

QFontEngine is not always loaded from QFontDatabase, resulting in
the flag not being set.

Change-Id: I39bc5bd4a8dea153d191cfc55f4324195f75f64c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
windows: Set forward compatibility bit properly

The bit should be set when QSurfaceFormat::DeprecatedFunctions is
_not_ specified. The documentation was correct, the implementation
was not.

Change-Id: If7202d3a59d5336fff255a290b65fb4bfa7b79c9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Check the thread in QOffscreenSurface

The QWindow-based fallback will not work when the QOffscreenSurface is
created outside the main thread. Show a warning in this case.

Note that it is fine to use the QOffscreenSurface instance in another
thread. It is just the creation that must happen on the main thread.

Change-Id: If80da39e610813755b9ba2f6831b187b258b8266
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Fix coding style in QLabel example code

Change-Id: I13838c1759b14089ba9f4daf442048fb5c8da738
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
QCocoaFileDialogHelper: Cache directory until delegate has been created

Task-number: QTBUG-34393

Change-Id: Idee9e879e586afe25fd099d157ed7af88c17c4a3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Do not disable egl on desktop gl automatically

desktop opengl and egl are not incompatible with eachother, so there
is no need to disable egl when on desktop opengl

Task-number: QTBUG-34949

Change-Id: I757c38674a480910d1cb23853c255eb993e107ff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
CMake: Parse the output of new CMake versions.

As of CMake 3.0, the output of `cmake --version` now has a second line
showing that it is maintained by Kitware. Change the version parsing to
look only at the first line of output.

Change-Id: I347de4c376e0bde25a43a38d59587d9b63f6b43a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Allow resetting Qt::WindowFullscreenButtonHint

Currently Qt::WindowFulscreenButtonHint is only
respected on window creation. But flags
can also be adjusted later on.
Further setWindowShadow can be removed from
within createNSWindow, as it operates on a Nil
object in that case. It is however called by
recreateWindow / setWindowFlags subsequently.

Change-Id: I507d6fde5ad2f0ee5b9db322325ede99b70e151e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Fix directwrite font engine compile

Add missing comma that prevented compilation.

Change-Id: If771366adf3a31427c2beefa09c0206653f8ec84
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Return the xcb_screen_t and not the QPlatformScreen

from QXcbNativeInterface. The QPlatformScreen is available from
QScreen::handle()

Change-Id: If81daf34c07f4a49c85c43d3755d1a9167626d6d
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QPrinter - Make PDF support required for QPrinter

Most of QPrinter assumes that QPdf is available as the fall back engine
in case either the plugin fails to load or there are no real printers
configured. Make this assumption explicit in the feature configure and
remove the two places where QT_NO_PDF is actually checked.

Change-Id: Ibb1bdf3bafa5809fbc844c84d7127911a1685506
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>