Fix platforms.pro to match new qnx mkspec name

cherry-picked from Qt5/qtbase 4ba895a86

Change-Id: Ic15d00df4b83d4510ea9622d74e988515fbfbae5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Fixes codecs.pri to reflect new QNX mkspec name

Change-Id: I7d22d48b189e8abfd6164a51b1e025360ef3da5a
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Use QSocketNotifier instead of sleeping in an endless loop

Event driven listening for navigator events, basically a backport of
the respective QPA plugin code in Qt5/qtbase

Change-Id: I120a755af614d35a9e5a0e755c521bbf8bf0d13d
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
BlackBerry Plugin: support 8 mouse buttons, instead of just 3.

The mask of possible mouse buttons in QNX provides tracking for the
up/down State of up to 8 mouse buttons. This update adds support
or 2 of buttons which we previously ignored in Qt on this Platform.

Backport of a0933f4d7485d22f38b80c67f79b8d3f721b19a2 in Qt5/qtbase
reduced to the 5 buttons Qt4 has support for

Related to task-number: QTBUG-24682

Change-Id: I4253b96b2d7ed3f806749432b2eb7f884fd0f580
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Rick Stockton <rickstockton@reno-computerhelp.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Windows - fix QWindowsSystemProxy global static race

Loser of the race would try to delete an uninitialised pointer

Task-number: QTBUG-15765
Change-Id: Ie184ee2306e102aa8fbad752ef09b95c3ede00c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2cf8e487a5c546382daaa954c23d3926668b0a85)
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Windows - fix proxy types for manually specified proxies

When the windows internet options are used to specify a
different proxy for each protocol, assume the proxy server type
matches that protocol too.
e.g. "socks=qt-test-server:1080" is both tagged for socks, and
assumed to be a socks server.
"ftp=qt-test-server:2121" is assumed to be an ftp proxy
"ftp=http://qt-test-server:3128" is overridden to be a http proxy
used for ftp.

Task-number: QTBUG-10502
Change-Id: I70615c89d6ede53f0e7d62e6d0754b90d042aa2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a7489b2ba3f2f3ea28d6fff0c835c12b0666af45)
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Windows - handle proxy autoconfiguration resulting in no proxy

The PAC file may result in direct connection, in which case
WinHttp returns null strings for the proxies and the connection
type marked as direct.
In this case, return the default list (no proxy)

Change-Id: I601033f56a841bb92ea80a28174bb993b024ad79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 25c05ce3bb8b53ed937363492b8222ee3b83d749)
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Windows - fall back on static proxy config if autoproxy fails

If both manual proxy settings are configured and the autodetect
setting is enabled, fall back on the manual configuration when
auto detection fails.

Task-number: QTBUG-10428
Change-Id: If008c7c967eec6256ce3c614fff0ec258190d451
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
(cherry picked from commit 276f64d21d7b877044fddd646b855829950099b0)
Fix a number of bugs with windows system proxies

TcpServer requests always returned no proxy, even if socks was available
Tag handling was broken for empty tag (if system proxies were tagged)
Tag handling was broken for unknown tags - now handled the same as if
    no tag was given at all.
When there are different proxies for http and https, windows returns
the http proxy first. However we should prefer to use the https proxy
for general sockets, as it's more likely to support the CONNECT method.

Change-Id: I55dcadf2e142367e857f94e55fdbb0c4ddb513a3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
(cherry picked from commit ea92d02b6ba873c10153dc6ab7472edf07f99f03)
Windows - handle both auto detect proxy settings together

If both "automatically detect settings" and "use automatic configuration
script" are selected in internet options, then respect that.
Because of performance issues, these are tried separately, and
disabled if they fail.

Task-number: QTBUG-13957
Task-number: QTBUG-10238
Change-Id: Ibc824d3039afeaf12c5ea82ed95287e5cf4e1776
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
(cherry picked from commit 4cc8209998c386a4372f10496f0c97f3d86f92bb)
Rework QNetworkProxyFactory::systemProxyForQuery autotest

Rather than requiring specific hardcoded proxies in the system,
it now checks the proxies returned by the system have the required
capabilities for the request.

Note the test will pass if no proxy is configured (as
QNetworkProxy::NoProxy has all required capabilities)

The test prints the returned proxy lists and elapsed time
diagnostic for manual comparison and debugging.

Change-Id: I621ef4d1d7264a98c3e8bd485c30bc1166fcbdf0
Task-number: QTBUG-19454
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3c529933612ff022d139975d661e37c77b1b2e99)
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
mkspecs: don't forget to add 'qnx' when building for x86

When building for the QNX/x86 target, we forgot
to add the 'qnx' tag to CONFIG. This causes
failures when third-party libraries using qmake
try to scope on qnx.

This change mirrors what's in the ARM target.

Change-Id: I28e1df4d8636385c5555a2bb4087d26a8a9b4220
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Fixed wrong iconv_open call under QNX

The wrong macro logic was causing iconv_open to never be
called under QNX.

cherry-picked from qt5/qtbase 8a15c41d36b1905a2

Change-Id: I0a1e3fb01d726daca637f8f51abfc924cd493311
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Fixes mismatching delete operator

cherry-picked from qt5/qtbase 657f634c0e8a1bf4f544b

Change-Id: I35cbdd6fa947a98a6afa70bdc72631c4213c288a
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Support changing locales at runtime in QPA plugins.

Change-Id: Id65798b81db2fa9fb5b1d929e4a94103995c6707
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Hang on to the correct screen index in QWidget

Hang onto the screen index that this widget should be
placed on in case the platform cannot move the window onto the screen yet,
when window is not yet created and the plugin cannot access the topData
to update the screenIndex. When this variable is later referenced
after the window is created, it defaults to screenIndex 0,
so the window is never moved correctly.

Change-Id: Ica78fd90aa3dacc29f81b2f6bd6c8b45d2fb2961
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Improve type detection for query results

When an aggregate function is used for a column in a SQL resultset then
it should ensure that the right data type is reported for that column.
This also concerns expressions when the returned column does not map
directly to a table column.

Test included for this.

Task-number: QTBUG-22038
Change-Id: I681297accc979081d14b44d190ab9d5f83aac215
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
(cherry picked from commit 678ab52ccba0b6a6903e9aee404dbe84fb74c91d)
Removed invalid assert in BMP loader code.

Task-number: QTBUG-24505

Change-Id: Icec4d2c06175e29c5995399d0584c1ca76dc39d2
Reviewed-by: aavit <qt_aavit@ovi.com>
Harfbuzz GPOS hinting- do not consider a subtable to be invalid if it is just empty

Considering a subtable to be invalid when it was empty meant that it
returned an error causing all further hinting to be aborted.  This means
that we get no hinting in certain cases with certain fonts.

Change-Id: I840c016dc85935b4f2c4373c66a79b4bd8b3a30d
Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Optimise QFile::seek that doesn't move the file pointer

If the seek position matches the current file position, then
avoid doing an implicit flush that could be expensive.

Change-Id: I019858ffb36fe832b9aee8da0a7803cafc8f7f75
Reviewed-by: Jaakko Helanti <ext-jaakko.helanti@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>