Cocoa: Establish pattern for accessing globals

Use a static QCocoaIntegration pointer instead of
QGuiApplication. This removes the need to call out
of the platform plugin as well as the casting from
"platform" to "cocoa" types.

Change-Id: If432b3567811223b73a67548e475e07d63635b73
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Obsolete AA_ImmediateWidgetCreation.

This attribute is not guaranteed to fully work with QPA.

Task-number: QTBUG-36489
Change-Id: I638a8e00851288012be553b5316aa6088dd67cff
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Remove some left-over +1 in font height calculation

In change cb8445f0323b0eefbb04f1d8adad81a00b53abd8, I tried to
remove all the historical +1s when calculating the font height
from the ascent and descent, but I missed a couple. These are
used when drawing the background for the text, the height of which
would no longer match the height returned from QFontMetrics.

[ChangeLog][Text] Fixed off-by-one in the height of text background.

Task-number: QTBUG-36444
Change-Id: If6d87f903e246f9faed2298bb1693b2556906eed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Support empty inline elements in block tags in QTextDocument

This fixes the following case:

<blockquote>
<span />Foobar
</blockquote>

Qt would see the end of <span>, and consider the current block
tag as closed, thus resetting the block format, thus losing the
margin set for the current block (due to blockquote).

If you do

<blockquote>
<span>Foo</span>Foobar
</blockquote>

instead, then the same would not happen, since hasBlock is set
to false when we append text to the current inline node.

[ChangeLog][QTextDocument] Add support for empty inline elements
in block tags.

Task-number: QTBUG-33336
Change-Id: Ic566edfec96cb8d44d1c02932bb195bc921d1580
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Adds the ability to not have an activity on Android

That code allows for not having an activity on Android.
In my case I've made some java code to handle an Android service.
The code is mainly about not dereferencing null pointers.

Change-Id: Ia7fda03cbbc55e6afeacd928445a4b72b51c679e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Move documentation of AA_MSWindowsUseDirect3DByDefault into obsolete section.

Change-Id: Id45ddb760d1ec56741314f1125ad03d172c8e1a9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
QPrinter - Clean up Print Engine Key defaults and tests

The PrintEngine keys are not consistently treated across the platforms
and are not properly tested.  Start the process of making the print
engines behave consistently by documenting and testing the current
behavior. Ensure all unsupported features return a consistent
default value.

The auto test for valuePreservation() has been flaky depending on the
platform and installed printers so remove it and replace it with more
complete testing.  If no native printers available then don't test
the native engines.

Fixes for the individual inconsistent keys will follow.

Task-number: QTBUG-26430

Change-Id: Iab914d7e0a5ae4a2cdc24c8645751f0910cf440c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPrintEngine - Fix PPK_DocumentName

Add support to the Mac print engine for set/get the Document Name using
the Job Name setting. Our documentation states this is one use that the
document name will be put to so is appropriate to be used.

Change the Windows print engine to default to a blank Docuemnt Name
consistent with the other print engines. If still blank when printing
then use a default value.

Task-number: QTBUG-27724
Task-number: QTBUG-22144

Change-Id: If590811b5720e6f759eabc290b578b94e221f9f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPrintEngine - Fix PPK_CollateCopies

Mac supports Collate Copies using native api, so add support.  Note
this is mostly only useful for setting the print dialog default, as
Mac supports server-side multiple copies so the app will never need to
collate the copies itself.

Change PDF and Windows to default to collate true to match Mac as this
is the behavior users expect.

Task-number: QTBUG-27724
Task-number: QTBUG-35251
Task-number: QTBUG-22144

Change-Id: Ia43dbc260b3a71aa5b267cca54c168ffbea794fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPrintEngne - Fix PPK_Creator

Add support to the Mac and Windows print engines to preserve the
creator name when switching between native and pdf format.

Change-Id: Ie036af3140f24d8e34aa886f091384f93aa0157b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPrinter - Fix Printer Selection option on Windows

Make the printer selection option api public on Windows to be
consistent with Mac, and with the print program api which is already
public.

Change-Id: I3da9684288348eaa43276ca8534a1d5809f7027b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPageSetupDialog - Add manual dialog test

Add QPageSetupDialog to the manual dialog test.

Change-Id: I5a7a4fedf1fe3ba074891eaed84efaa1c173e620
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPrinter - Fix PaperSources

An earlier commit add new PaperSources for First and Last, but after
looking at wingdi.h it turns out these are just the first and last
DMBIN values, and Upper is equal to OnlyOne.  Remove First and Last, but
keep the Upper and CustomSource for use later by PPD based printer
systems.

Change-Id: I298472a1f54efcc584e73dec944b96fc91426c1b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QPrinter - Enable changing of Orientation on Mac

Since OSX 10.4 it has been possible to change the page orientation
during a print job.

Task-number: QTBUG-27630

Change-Id: Ic3c69e83afebbb9267ef6f435f968aeef2b72963
Reviewed-by: Lars Knoll <lars.knoll@digia.com>