Add devicePixelRatio metric to QPaintDevice.

Previously QPainter computed the devicePixelRatio
based on the physical and logical dpi, and expected
that the ratio between them would be either 1x or
2x.

This was problematic for paint devices like printers
where the physical dpi can be much higher than the
logical dpi, and also for QScreen where the physical
dpi would have to be defined as a multiple of the
logical dpi.

Add QPaintDevice::PdmDevicePixelRatio and QPaintDevice::
devicePixelRatio() getter and implement it for the
QPaintDevice subclasses. Use it when calculating the
highdpi scale transform in qpainter.cpp and when scaling
the clip rect in qwidget.cpp.

Remove physical dpi scaling for QImage, QPixmap and
QOpenGLPaintDevice, reverting to the old behavior.

Change-Id: I6c97510613196d4536ff39d08e9750b8782283d4
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Make QGLPaintEngine work on retina displays.

QGLWidgetGLPaintDevice::size now returns the size
in device pixels.

This fixes the QPainter "overpainting" and GraphicsView
with a QGLWidget viewport use cases.

Task-number: QTBUG-30217

Change-Id: I01998d39d7b4d755cf8b7b3fab5f75cd0d899ccf
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Cocoa: Enable touch on 0->1 counter transition.

Change-Id: I9d8fb84851a866c3020cbbca13d5b2dc297cfe65
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Cocoa: Create QCocoaWindow when enabling touch.

The ref-counting and (native) touch enabling is
implemented in QCocoaWindow.

Change-Id: I4f3f5e16db59afec7dd7dd2f8360dd60b90bfe6d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Cocoa: Fix popup menus on modal windows

Previously, we used -popUpMenuPositioningItem:atLocation:inView: but
this turns out not to work with modal windows. This can actually be
reproduced in Cocoa.

Change-Id: I9b750d1f97637f0cc30329d3da3acf5200f62206
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Don't warn on 0x0 sized windows.

I don't think this is an user error. If it is then
the warning should be in a cross-platform code path.

Change-Id: I4c615d9b2372660bb03b17ccb25204b2a8d17b1a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Added qtwaylandscanner rules to wayland-scanner.prf

In preparation of change in qtwayland.

Change-Id: I337ea9f48bf692f31e406c47d9256ee0263d33f0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Cocoa: Fix unresponsive main window after running more than one modal session

For some reason, we postpone clearing the stack of modal sessions until we call
processPostedEvents() again. However, it also means that when we clear the second
modal session, that session keeps running although we just closed its window. The
reason why it isn't stopped is because it wasn't the topmost modal session in the
stack.

This patch fixes the issue by stopping a modal session if any session above in the
stack has been stopped. This makes it less problematic if we don't call
processPostedEvents() in between ending modal sessions.

Task-number: QTBUG-30504
Change-Id: I9f898250ae629947d066647f9d5a0b9f75cf0070
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
fix padding periods in configure help text

A gap after option name is needed to select it with double-click.
Also I added padding periods for -testcocoon because it has no them before.

Task-number: QTBUG-30589
Change-Id: Ib5b970f9b17cad43609fbc53dd05a995aaf29b45
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Make qtbase compile with QT_NO_IMAGEFORMATPLUGIN

qfeatures.h re-generated from qfeatures.txt because
QT_NO_IMAGEFORMATPLUGIN was missing

Change-Id: I1c9291529ec07f83f99c9cd08340cbfebda609b6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Add autorelease pools needed by Qt Creator.

With these Qt Creator startup is now warning-free
on 10.6.

Change-Id: Ie29d360611c0e516258920163e4e94d174217299
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Add autorelease pool for cocoa plugin creation.

Prevents mem leaks at startup on 10.6.

Change-Id: I5f8b72c54ab396ee0ec2e47320163a6a342b78f1
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Fix incorrect compiler-from-mkspec selection in configure

Semantic error in selection for MSVC 2010.

Change-Id: I9ad97784cdb1a060df41bd1bb4e6c9f43adb387c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Remove dead code

Just some code that was commented out and only adds to the
confusion.

Change-Id: Icfdf81de9731eeb2c473a2f6e2723742601a2037
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Remove code for Android API level < 9

We don't support API levels < 9, so we can simplify this code
a little.

Change-Id: I9823d4c5a44d265e03dec0ceedeeb3c34a1e1eab
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Make surface and window accessible to subclasses

We need to access these in the Android plugin.

Change-Id: I8c7f279bbe0b7087260cceb1f965c833c0097984
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Android: Implement a hack for qmake /dev/null usage on Windows.

Neither /dev/null nor NUL work with Qt on Windows. For now, use
an empty file for the cases where qmake is used with /dev/null.

I filed a bug for this:
https://bugreports.qt-project.org/browse/QTBUG-30562

Change-Id: If5351214ae5a0ebe50ae46b155c327ca0dc59f98
Reviewed-by: Alvaro Burnett <alvaroburnett@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
eglfs: Make sure virtual functions are not called from ctor

We want to override some of them in a subclass.

Change-Id: Ic7a22d7bc4589199b3f764157125094a4ff6ec28
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Mark as unused the private members that aren't and CANNOT be used

Those members were left uninitialised by inline constructors and/or
the destructor of those classes is/was also inline. Those members
cannot be used to store pointers that need managing during the Qt 5.x
lifetime.

They can be used to store simple values, as if they were integers.

Detected by Apple Clang 4.2.

Change-Id: I20e2def7c4006668e2d6a7e332c89e2dc8c2a184
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Re-shuffle the configure output

Keep options sorted and use indentation to group together related
options (QPA backends, image formats and SQL drivers).

Change-Id: I97d330a13a4daa4567ff741dc26e11f458ae7f53
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>