configure: postpone pkg-config detection until after qmake is built

pkg-config isn't used before qmake is built, so these tests can take
place afterward.

This is preparation for using qmake to resolve PKG_CONFIG in mkspecs.

Change-Id: Icedf9ebd80bbac3fe1e5d7eeca358cb0fc9de072
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
use qmake to get PKG_CONFIG in configure script

The value of PKG_CONFIG might depend on device options.
For example, "-device-option PKG_CONFIG" might be used with configure
or a mkspec might prefix PKG_CONFIG with CROSS_COMPILE which is
specified as a device option.

The shell functions of configure for parsing mkspecs do not take
device options into account, but qmake is pretty good at it now.

backport of qt5/qtbase 01864d4854557d2cf8b067e229d77cd7c9c553ee

Change-Id: I1c9558e550c48e8441ebdac34b82066473c2ce3a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Disable SSL compression by default.

Disable SSL compression by default since this appears to be the a likely
cause of the currently hyped CRIME attack.

This is a backport of 5ea896fbc63593f424a7dfbb11387599c0025c74

Change-Id: I6eeefb23c6b140a9633b28ed85879459c474348a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
Fix build for platforms that use QPA other than IOS

For instance on Blackberry this would try to include Mac libraries as
well.

In Qt 5 this is still working.

Change-Id: Iae9d3b7e1b988ac8932c58deabfeb249cd2cfc2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Fixed potential use of uninitialized variable in qgl.cpp

If glGetBooleanv fails this variable is left uninitialized.

Task-number: QTBUG-26952
Change-Id: Idb42833f2907bb66fd87c5cdb39753fca04e7438
(cherry picked from commit 0d55b4596f490f8f64eb3134e77e59df7d1c16f9)
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Rotate non maximized windows

There are two types of rotation to be considered:
1. Rotation of native widgets
The corresponding window should be rotated and resized proportionally to the
new screen geometry.

2. Rotation of toplevel windows.
The window will be only rotated. It will be only moved or resized if it
becomes clipped, in order to be fitted on the screen properly.

cherry-picked from qt5 89d9f8fe949e65e7455fabe288ea284aa6de06b1

Change-Id: I837da53f1a12a7b8aff1e0e9d6f4579e3aefaf2a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
configure: mac features don't belong on cross mingw target

CFG_MAC_DWARF2 and CFG_MAC_XARCH options are for targetting macs, not
bulding on them.

qt5/qtbase commit 7a67c822e3e552d0d881f0409a5316de07dbb8c7
removed CFG_MAC_DWARF2.

qt5/qtbase commit 59d5c26075724a581ed276d62d884b44d2ca4489
removed CFG_MAC_XARCH.

Change-Id: Idb789ed9a8aa9b824a4c2191a9c39e741ca49574
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
float->int error in OS X Mouse Event Handling

NSEvent for mouse events contain the mouse position in floating
point numbers. This value is truncated/floored for mouse clicks.
Qt instead rounds that value, so mouse move events can get positions
that are slightly off sometimes. This solves #QTBUG-27273.

Change-Id: I2d3f59a09f50cb83dc1ccf6de940b7d99087c9ee
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
test: Mark tst_QFile::writeLargeDataBlock() unstable failure as XFAIL

The test has one unstable failure on Windows, so mark this with QEXPECT_FAIL

Task-number: QTBUG-26906
Change-Id: I2f6c63ddefecacd224d93f83e6951e961a02a051
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
(cherry picked from qtbase/531b96f42ef225f6f680f6049ab718b0f6729a3d)
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
QNX: don't show the virtual keyboard when focusing an item view.

This patch is not needed in Qt5, as it works as expected.

Change-Id: I3d165c3f5b8562207af20a0564c3884270d17b44
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Fixed inconsistent rounding of square cap pens.

A horizontal line should round up at the same time as a vertical line
with square cap, when rendering at subpixel coordinates. Thus, the
special casing in the cosmetic stroker of offsetting by half a pixel
should be for flat caps instead of for square caps.

Task-number: QTBUG-26013
(cherry picked from commit 72aaba336c7afe6d79d59995bfb31a8effca4e9e)

Change-Id: If7e7c6b6e37c5b1ce4685012a11fd29ff0b1df5a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
HTTP header may be damaged - fix, unit test

"HTTP/1.1 100 CONTINUE\r\n"
If the header from a server is splitted between two packets
the first packet contains "HTTP/1.1 100" and the second one
contains " CONTINUE\r\n", one space (0x20) is skipped. After
processing the line looks in this way "HTTP/1.1 100CONTINUE".
QHttpNetworkReplyPrivate::readStatus(QAbstractSocket *socket)
is called twice, if a http header is splitted as above.
The function always removes whitespace from the beginning of a packet,
even if it is the second part of a http header

QHttpNetworkReply returns QNetworkReply::RemoteHostClosedError
due to damaged http header during processing.

Task-number: QTBUG-27161

Backported qtbase/60f4fc8b706db9cbeacd5dc4886a7aa347daafc0

Change-Id: I07ec43641bbb9966285a8a1f57a51fb27d2643d4
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Revert "Delete JS-owned QML objects right away in the engine dtor."

This reverts commit ecc432a5b7ae269220f86c6f0b3dd364f8643191
to fix a crash on exit.

Task-number: QTBUG-20377

Change-Id: I6606ff194f2c16e06bdbbfca94e55821cf055f75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
QElapsedTimer: Fix typo in restart() documentation

Change-Id: Iac5df9edbe16ec841f783bc5266091a6e34e9cab
(cherry picked from commit 4efd73bc3ac318ec40adea2f21b3c9359ea1795a)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Include the signal code in the argument of (dis)connectNotify().

As it turns out, the convention of (dis)connectNotify() is to include
the signal prefix, i.e. '2'.
Therefore add this prefix also when calling these functions from QML.

Also add a unit test confirming that the C++ and QML cases are now
handled the same way.

This patch is not needed in Qt5, as connectNotify() and
disconnectNotify() take a QMetaMethod as a parameter, not a
const char*.

Change-Id: I3add0fc13c60a479949cf3d31218af5fd3f546a2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
cleanup CUPS tmp files

Set fd in openPrintDevice() so that it gets cleaned up properly
in closePrintDevice().

Backported from the Qt5 commit:
99bab571b4cb41362e891f1bb1e812119701c932

Task-number: QTBUG-14724

Change-Id: I02968d597822b636078ae89566dd8ed8a948019b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Avoid crash caused by drag and drop and winId()

Task-number: QTBUG-27263

QWExtra object pointer is not guaranteed to be valid in
QWidget::unregisterOldDnd() since commit
f6bf4b2baa91e55f40596bf3f2823b119fdfa5e0. To avoid crash we have to check
QWExtra object pointer of the native parent widget before access it, and
if the pointer is not valid we should check its native parent widget
recursively.

Change-Id: I764fea4a0826cff751dd74a0fb67e0d2971c1d49
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Load Mac specific resources in a static build

When Qt was built statically then the Mac specific resources were not
being loaded which meant some style specific images were not used.

Task-number: QTBUG-25391
Change-Id: Iad538b5f1935ed1744617d6e47ae3e68aa36afac
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Fixed outline / fill inconsistencies in raster paint engine.

We did coordinate rounding of the fill in the raster paint engine to
match how drawLine_midpoint_i rendered lines. With the new cosmetic
stroker in 4.8 this rounding is not needed anymore.

Task-number: QTBUG-26013
(cherry picked from commit b6acec1e5d55d03ad3a0a70d2cf371d3f8fde629)

Change-Id: I0324e3a45c525890fb58817a180c6aa712716780
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[QTBUG-27308][QTBUG-21534] Don't mouse-wheel-scroll QScrollBar when disabled

The Qt 5 fix (aec5b76) doesn't apply here, because it introduces
a new symbol that might break forward compatibility if code
compiled against a newer Qt 4.8 is run against an older Qt 4.8,
and QScrollBar::wheelEvent() ends up being devirtualised.

So copy the guard clause from QWidget::event() here.

Task-number: QTBUG-27308
Reported-by: chenjiexin
Task-number: QTBUG-21534
Reported-by: Martin Koller
Change-Id: I5d2f823c65bae8cff33bac320c37e6496b14646c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>