Cocoa: make accessibility hit test not crash

Check if the accessibility element is valid before
calling childAt.

Change-Id: Id63c11f18b262c3c3a839db8ee2d11c0d7adc822
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
xcb: notify when the logical DPI changes; add Q_MM_PER_INCH constant

Change-Id: I15696bf45ae99cc5b0fd95dab4884fc85cbfc6da
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
QImage plugins should report supported mime types

Introduces the methods QImageReader::supportedMimeTypes and
QImageWriter::supportedMimeTypes which corresponds to the similar
supportedImageFormats methods, except they return lists of MIME types.

Task-number: QTBUG-28177
Change-Id: Ibb0e264a12eaf972a8bfd6bd891dcd9f89efd085
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPA: Add interface for setting the application state explicitly

The motivation for this patch is twofold:

1: we need a way (for iOS/Android) to tell the current window to remove
focus from the focus object when the user hides the input panel.
Otherwise, if the focus object is e.g a line edit, the cursor will
continue to blink inside it, which is wrong. As it stands, telling
the active window to deactivate
(by calling QWindowSystemInterface::handleWindowActivated(0)), will cause
the whole application to deactivate if no windows are active, which
is not what we want.

2: Qt currently understands just two application states, Activated and
Deactivated. On mobile platforms we can have other states
as well, like "suspended" on iOS. So controlling the application
state should not depend on window activation, but instead be controlled
through a separate API by the platform plugin.

This patch will add the following function:
QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState newState)
that lets us control the application state from the plugin. This also
means that we factor out application state handling from window
activation, which also gives us a way to remove focus from a window while
keeping the application active.

Investigating which states (other that active/inactive) it makes sense
to add to Qt::ApplicationState will be a topic for later patches.

Change-Id: Ic6fdd3b66867abb67da43eba04ec86f06d82ff94
QPA: Add WindowSystemEventQueue::removeType() function

Currently there exist no function to remove already posted events
from the QWindowSystemInterface event queue. This is needed in a
later patch where we need to cancel a posted application deactivate
event when a new window is suddently told to activate.
(Otherwise we will end up in a state where Qt tells a window
to activate, just to receive an application deactivate event in
the next event loop cycle).

This patch will add WindowSystemEventQue::removeType().

Change-Id: I6dd8c76713e6092033da74132c701284ea0207f4
QPA: Add default application state handling to handleWindowActicated

Since all desktop platforms so far should activate the application
when at least one window is active, and deactivate in the opposite
case, it makes sense to factor this logic into one common
place that can be controlled/avoided by specifying a boolean argument
to handleWindowActivated.

Change-Id: I36f26308d471571e608df0a5daf6d1b61b84bcba