Fix CJK languages support with HarfBuzz-NG

By some reason, mapping to Han script doesn't work for some (most?)
fonts. Until the issue is really fixed, pretend the HB-old behavior
and simply map to Common script.

Change-Id: I4c146f5ff2a42f64b971b2f5ebd7f65e2513fdf0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Increase timeout in tst_NetworkSelfTest.

Try to fix frequently failing test:

FAIL!  : tst_NetworkSelfTest::ftpProxyServer() Failed to receive data in step 32: timeout
tst_networkselftest.cpp(230) : failure location

on Windows. Introduce timeout constant, add message.

Change-Id: I709f0b34cd1cfe5d3c64cf61ccb7907bd616bc54
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Skip the test 'abort' of tst_qftp.

The test takes too long and fails:

FAIL!  : tst_QFtp::abort(WithoutProxy:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxy:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxy:put_fluke01) 'bytesDone != bytesTotal' returned FALSE. ()
tst_qftp.cpp(1406) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5Proxy:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5Proxy:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxyWithSession:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxyWithSession:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxyWithSession:put_fluke01) 'bytesDone != bytesTotal' returned FALSE. ()
tst_qftp.cpp(1406) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5ProxyAndSession:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5ProxyAndSession:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
Totals: 327 passed, 10 failed, 4 skipped
QtQA::App::TestRunner: warning: test duration (398 seconds) is dangerously close to maximum permitted time (450 seconds)
QtQA::App::TestRunner: warning: Either modify the test to reduce its runtime, or use a higher timeout.
QtQA::App::TestRunner: test failed, running again to see if it is flaky...

Change-Id: I122641f174927c6b3668df05c79f88e38b88042f
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
QNX: Change the way one requests child windows

The use of Qt::Dialog as a way to signal that a parentless window be created
as a child proved problematic as some applications use dialogs as their sole
window.

Instead, rely on the existence of a dynamic property called 'qnxWindowGroup'.
If found, the window will be created as a child window and that window group
will be joined.

Also added the ability to set the id string window property via another
dynamic property 'qnxWindowId'. While strictly related to the original
issue, one typically needs the ability to set the window id if one
is joining a group.

Added extensive documentation on the mysterious rules of the QNX QPA as
regards windows, at least covering the areas affected by this patch.

This patch was originally implemented by Roger McLean.

Change-Id: I0ef88d654b794ddcb54d4c4d9804bef750da5a33
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Remove unused parameter from QEGLPlatformContext constructor

The API is chosen via QSurfaceFormat, the constructor argument is ignored.
Remove this historical artifact.

Change-Id: I4a5c1e12cb297de22f239ad0a6747c1c36168eed
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
egl: Update the OpenGL version in the context's QSurfaceFormat

The GLX and WGL support code does this already. Do it for EGL too since
requesting OpenGLES with majorVersion 3 results in GLES3 (where supported)
and in this case the expected majorVersion in QOpenGLContext::format() is 3.

Change-Id: I73d61d7569e6ebaa91aef57fb1b0051a77a73355
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
egl: Choose GLES3 capable configs when needed

Passing OpenGLES and majorVersion 3 in a QSurfaceFormat selects GLES3 in case
it is supported. This works fine already now, but is not safe since the config
choosing logic does not request a GLES3-capable configuration and so it may
end up with a non-GLES3 compatible one.

This is now corrected by passing the EGL_OPENGL_ES3_BIT_KHR bit when
EGL_KHR_create_context is available.

Change-Id: Iacee1e1819b944c0f7c1062666106abddf59272b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Add EGL_KHR_create_context support

[ChangeLog] GLES3 and desktop OpenGL are now fully supported with EGL

Task-number: QTBUG-37332
Change-Id: Ic695db573d90b3a204941d105a370f5c63182b63
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Guarantee QPFDB::fontEngine() always return non-multi font engine

After QPA refactoring, QWindowsFontDatabase::fontEngine() was returning
a multi font engine w/o any particular reason.
This makes the code more obvious and opens the road to further improvements.

Change-Id: I4858026ddf774d3159c89357b1c905f5112b1c51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix custom font substitution list support

During the QPA refactoring, the custom font substitution list support
was lost by ignoring the font request's fallbackFamilies member
when the multi font engine gets created/initialized.
If fallbackFamilies is not empty, it should be prepended to the
font database default fallback families list. Also respect the
custom fallback families list in the cache key to avoid picking
a multi font engine with wrong fallbacks list.

Task-number: QTBUG-36628

Change-Id: Ie2b84b3a397bee4816f421cddf76a5375829f13a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Remove need to populate font database on OS X to get fallback families

Populating the whole database takes a while, and it's very easy to trigger
the fallback family code path through eg. matching or getting the default
font family from QFont.

Instead of relying on populate to resolve family name to a PostScript name
(which was required when using CTFontCreateWithName), we instead use the
CTFontDescriptorCreateWithAttributes() function to create a descriptor
based on the family name, and then use CTFontCreateWithFontDescriptor().

The other way around, we use CTFontDescriptorCreateWithNameAndSize, and
then pull out the family name from the descriptor. The need for creating
a CTFont for private fonts (eg '.Apple Symbols Fallback') does not seem
necessary anymore, as tested on 10.7-10.9.

The disadvantage of creating font descriptors instead of re-using the
data computed by population is that we're doing the same work twice,
but the end result is making the font database more lazy, and the 80%
use-case is assumed to be that you're only interested in the fallback
of a small number of fonts, which means you don't want to populate all
of the fonts in the system (taking about 1100ms on the test system).
Looking up the fallback of a single family or style now takes about
15-25ms.

Task-number: QTBUG-37165
Change-Id: I6b904dbe796a3f236919d778d0168fdef9a20e69
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>