iOS: Clean up QPlatformInputContext subclass header

Implements isValid(), which should be returning true for subclasses,
and re-orders and adds Q_DECL_OVERRIDE where appropriate.

Change-Id: I03519bf674b6f7b7ccc07a7154c9a1fb9a8105f2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Add missing host_build CONFIG for qlalr

Change-Id: I6eddd2afd9eb4dac0b28329003dbd3b6d05d3fd1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Don't say "Neon... auto" when ARM Neon isn't detected

Just say "no".

Change-Id: I382d612ad0a7f4031b1891e7e4d9158db07badf1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
[QStaticText] Fix potential font engine leaking

Never assume the engine is still cached but rather delete it
if we are the last consumer.

Change-Id: I4e3c796d45c53f42722a437482d71e2dae14cad2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Don't assemble QRawFont from QFont manually

Always prefer QRawFont::fromFont(..)

Change-Id: Ic33f7d3a468f926418b39887f572829af93f8c1d
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Fix potential access to uninitialized member

If GetTextMetrics() failed, there is no guarantee that
TEXTMETRIC is initialized with any safe values.

Change-Id: Idb5e3bc1bc2451368950978365487c908ce529e7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
[QAndroidPlatformTheme] Get rid of static QFont

QFont is not POD and shouldn't be instantiated statically,
otherwise we could end up with UB during qApp destruction.

Change-Id: I2372c7a643eb3007957ab2b798732c1a18fd0ae5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
[QPainter] Fix QTextItem painting with extended paint engine

Multi QFontEngine should be handled just like all other cases
covered several lines below.

Change-Id: If3dd9a2e38a5f6f61b113576cb188da378fc9efb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
QDistanceField: a zero glyph index means the glyph was not found

In qt_fontHasNarrowOutlines, if we proceed to call alphaMapForGlyph
when the glyph does not exist, there will be a failed assertion.
The docs for FT_Get_Char_Index say that zero means the glyph was
not found.

Change-Id: I371e9a2797a34fa3ebeae44531af51e24dadad79
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Windows: Respect hinting preferences with FreeType engine.

One of the fontEngine()'s methods was missing hinting. This bug only
manifests on Windows because on Linux QFontConfigDataBase already sets
hinting on both code paths.

Task-number: QTBUG-42534
Change-Id: I3a66a9d4aaa5e390fee305a3d5aacfeba38a1fc3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Improve diaglib.

- Fix prototype for glinfo() for Qt 4
- Add more event types and object type flags to event filter.

Change-Id: Ia4160b40486d054e860a339e7b5c9c28695330ae
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
don't use QCursor if QT_NO_CURSOR

to support configure -no-feature-CURSOR

Change-Id: I8e7f9a7f80d3d44a1f8e25b909d552351b5f37e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
sqlite: don't use deprecated QSqlError constructor

so that it can build with configure -no-feature-DEPRECATED

Change-Id: Id2decc05974bad249c79936d99ab63d3cfc375ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Android: replace qFind with std::find

qFind is deprecated, so these cause build errors with
configure -no-feature-DEPRECATED

Change-Id: Iefcb061d5e8ce256445528f601ead4c9d5d1dfd2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
XCB: send leave event on grab

When a popup is opened it grabs the input, but the leave event to the other
windows needs to be sent.

Remove the popupEnterLeave test as it did not test any code. The Popup
never gets any enter or leave events so it will succeed always succeed

Task-number: QTBUG-36862
Change-Id: I625c616eeb74b5168af7b751485e2a9a53b76cd3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Widgets, iOS: don't tell the input panel to hide on focus out

On iOS, autoSIP is handled by the platform plugin. We therefore
avoid letting widgets tell the input panel to hide on focus out
so we can gain better control over this from the plugin.

Note that we could also set QApplicationPrivate::autoSipEnabled
to false and achieve the same. But since autoSIP is logically set
on iOS, it's better to report it as set in case the app asks.

Change-Id: I96c68bc446a1e299fd57afe03a9e273491df08a7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: only skip activating the most simple popup types

The current approach of not activating transient windows with the
popup flag set was found to be too restrictive, as it would
e.g stop transient dialogs from being able to contain editable
controls.

This patch will restrict the number of popup types that we
skip activation for to only contain a few subtypes.

Task-number: QTBUG-41613
Change-Id: I381a5a79fb4f7082da18a6b4e06a7255ff400b1a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reorganize devicediscovery header

As pointed out in 13b939c7f41bceb2061e549923eab242326e9bb5 the approach
qdevicediscovery_p.h takes is just wrong. The defines it relies on will
often be missing when the header is included from random places in qtbase.
This results in different class layouts. It was working only because the
interface of the class is very limited and the public part was matching
regardless of having the macro defined.

This is now corrected by introducing subclasses and a common, non-variated
base class. QDEVICEDISCOVERY_UDEV is removed completely.

Change-Id: I9c83b5b041440a3a6ea3a604eee4a325d4d74439
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Add capabilities to QPlatformInputContext.

Add a capability enumeration to QPlatformInputContext and
use that to turn off input methods for hidden text depending
on platform support. Disable on Windows.

Task-number: QTBUG-40691
Change-Id: I9909005de1f21316ec8f64e2729f1fffcd37c7c3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Windows: Correctly associate IME contexts.

Associate a 0-context with the window if IME is disabled, store
this state as a flag to QWindowsWindow. Associate default context
again when enabled window gains focus.

Task-number: QTBUG-40691
Change-Id: I78d5494a05f93a39e245ca7c096d45445e684ea8
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>