Styles: improve SH_Header_ArrowAlignment handling

The docs were wrong, and the returned values from some styles
did not match reality, so fix that. Again, this style hint was
not used at all within QWidgets...

Task-number: QTBUG-629
Change-Id: Ie6ff80fd09bc3292ba3d787ccca4d6f4c0056e89
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
QHeaderView: take the sort indicator into account when eliding text

By adding PM_HeaderMarkSize to the margins if the section is showing
a sort indicator. Turns out that that particular enum was actually
unused in QtWidgets (!), so tune the value to match reality.

Task-number: QTBUG-629
Change-Id: I8bc70451656d634a064c8b5014e449977c55aa9d
Reviewed-by: Cristian Oneț <onet.cristian@gmail.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Support vertical sliders on Android

There is no such thing as a vertical slider in the native Android
style. Therefore, we need to rotate the painter in order to draw
one.

Task-number: QTBUG-41992
Change-Id: Ibe2bf1d7fa27756aad0b8469c8752d6d3e848527
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Attempt to make the positioning test of QWindow more reliable

The part of the test that verifies that setFramePosition moves the window
successfully appears to be very unreliable in the CI system. The "tested"
frame position is calculated to be at (40, 40) relative to the top left
of the available screen geometry, which can be non-zero due to task bars
and similar system ui elements. However that position appears to be
unreliable in the sense that the window manager doesn't seem to always
respect that. So instead let's try placing the window (by frame position)
in the center of the screen instead.

Change-Id: I96fe6c37e748fc18262632b5effe5a9e90dc0028
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Windows: Limit cursor cache.

Prevent the cursor cache from growing indefinitely hitting GDI resource
limits if new pixmap cursors are created repetitively by purging out
all-noncurrent pixmap cursors.

Change-Id: I4a3bbd6235af13e306ca84ac6fea3fcd69d53279
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Do not initialize accessibility code by default on startup.

Instead listen for if the accessibility service is running or not by
implementing AccessibilityStateChangeListener.
This seems to work smoothly when turning on or off TalkBack.

This should also improve startup time.

Change-Id: I3eb7d6cb9c9c1618afbb59675e4e089c9159019c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
qimage_conversions.cpp: Fix build on big endian systems

Change-Id: I8149eb2deaa101daf85a957ff48c3a7140c43bbc
Reviewed-by: Timo Jyrinki <timo.jyrinki@canonical.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Android: Make cursor keys work again

On Android, we disable mouse selection, since that does not work
well with touch screens. In change a03a69efb9ed89cd4a90878eda20,
we accidentally disabled keyboard selection as well. Unfortunately,
disabling keyboard selection will disable all keyboard movement.
This change re-enables TextSelectableByKeyboard.

Task-number: QTBUG-42991
Change-Id: Ie63ed3d88a0abcb72f04e0ec60a5b91c0b14a47e
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Removed redundancy in QGraphicsItem documentation.

Snippets [1] and [QGraphicsItem type] are the exact same, each
referenced once, and only in the same file.  Removed the later snippet.

Change-Id: I4f35a8322034b00e9b5f5d6c6d96e652f11f8384
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fixed small bug in code snippet for QGraphicsItem

If the enumeration "Type" isn't declared in the public scope, it will
cause an issue upon compilation.  Previously, it was ambiguous on which
access level this should be in.  Snippet [18] though has the enumeration
in the correct access level.

Change-Id: If699df80def3e1b09d8d82df74c4ca85eba003d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use categorized logging for ssl code

Place all debug output into the 'qt.network.ssl' category.
This allows people to disable certain warnings at runtime.

Task-number: QTBUG-43173
Change-Id: Ide731fae3109f9cd7730cc096ee069a5b99d35f1
Reviewed-by: Richard J. Moore <rich@kde.org>
doc: Clarify NOTIFY emission with MEMBER variables

Document that NOTIFY signals should be emitted only when really needed,
and that such is the case with MEMBER variables.

Change-Id: Icc38a0790aa43ffe8f24d124da966b4240a41a6f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Handle SelectionClientClose in QXcbClipboard

QXcbClipboard listens for subtype SelectionClientClose of Xfixes
SelectionNotify event, but doesn't handle it. When the client holding
the clipboard selection closes the Clipboard becomes empty and thus the
change should be emitted.

This fixes downstream KDE Bug #329174.

Change-Id: I19fb8cfd7bd3b249c0bc6ca2a724a9aeeb05ac7e
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Enable input methods for QQuickWidget

Make it possible for widgets to have non-widget focus objects. Since
we cannot add new virtual functions due to binary compatibility, we
have to do it in QWidgetPrivate.

Task-number: QTBUG-42677
Change-Id: I5f74daed2793c1c149bbe02e54ff2f7e2ad1af9e
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
GL2PaintEngine: Prevent fillInPendingGlyphs from breaking gradients

The glyph cache internally uses the image texture unit when blitting,
but doesn't always activate the unit before binding its texture,
resulting in sometimes binding the glyph cache texture to the
wrong unit.

The image texture unit is also the same as the brush texture unit,
so any time we fill in pending glyphs we need to re-bind the brush
texture, otherwise drawing text with eg. gradients will fail after
the new glyphs have been filled.

The new hasPendingGlyphs() member function of the glyph cache
is an optimization so that we don't need to activate and rebind
unless there are glyphs that need to be filled.

Change-Id: Iac74130145d2d6d7bf95206b5e8a2fc760743cb5
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
GL2PaintEngine: centralize logic for updating/preparing textures

Rewrite of updateTextureFilter to include activating and binding as well,
so that we can maintain a single view of which texture was the last one
to be used from within the engine itself.

The behavior should be the same as before.

Change-Id: I41781d00458b0176c614266f4360db3c68b120a1
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
iOS: Don't scroll screen on changes to input item transform

We auto-scroll the screen to reveal the cursor whenever the cursor rect
changes or other properties of the input methods are updated, but the
expected behavior when explicitly moving an item under the keyboard,
such as when scrolling a view or moving an item using drag, is to
not scroll the screen until typing commences. This matches how eg.
Safari or the Notes app handles the same use-case.

Change-Id: I6b6932d9bcbdccd8df26db982246c162f1574d86
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
iOS: Only scroll to cursor on keyboard hide gesture reset if requested

Change-Id: I15b313b5f0d57358e405f16e941fc5061028c6a7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
ANGLE: Do not use std::strlen

This is a cherry-pick from upstream change

e7cfb3dd2029c1bfe5c175ad994c03cac221ad4d

Change-Id: Iefe01545319f9ad268c0c6bf8e8b2181e09d8a84
Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
iOS: only clear focus object if it supports IM

We try to keep a on-to-one relationship between UI controls with text input
and keyboard visibility. But if the control does not use text input, then
there is no reason for us to clear focus when the keyboard hides. In fact, we
should avoid doing so, since that will stop e.g buttons from working correctly.

The typical flow is:

- a touch release targeting a button is sendt to QApplication.
- QApplication transfers focus to the button.
- qiosinputcontext gets notified, we refuse, and clear focus again.
- QApplication enters a propagation loop where it tried to
    find out the receiver of the event. Since the button is now
    unfocused, the event will propagate up to a grandparent instead.
- the button will as such not trigger.

Change-Id: I70baa38299f40defc4a77f62790502e2d6ebbba9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>