Update the qHash function for strings to use the CRC32 instruction

According to my profiling of Qt Creator, qHash and the SHA-1 calculation
are the hottest spots remaining in QtCore. The current qHash function is
not really vectorizable. We could come up with a different algorithm
that is more SIMD-friendly, but since we have the CRC32 instruction that
can read 32- and 64-bit entities, we're set.

This commit also updates the benchmark for QHash and benchmarks both
the hashing function itself and the QHash class. The updated
benchmarks for the CRC32 on my machine shows that the hashing function
is *always* improved, but the hashing isn't always. In particular, the
current algorithm is better for the "numbers" case, for which the data
sample differs in very few bits. The new code is 33% slower for that
particular case.

On average, the improvement (including the "numbers" case) is:

 compared to          qHash only          QHash
Qt 5.0 function          2.54x            1.06x
Qt 4.x function          4.34x            1.34x
Java function            2.71x            1.11x

Test machine: Sandybridge Core i7-2620M @ 2.66 GHz with turbo disabled
for the benchmarks

Change-Id: Ia80b98c0e20d785816f7a7f6ddf40b4b302c7297
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a placeholderText property to QPlainTextEdit

Setting this property makes the editor display a grayed-out
placeholder text as long as the document() is empty.

Change-Id: I997edb867419613ff7cedc760a87c684a2ded711
Reviewed-by: David Faure <david.faure@kdab.com>
Update QStandardPaths documentation with Android paths.

Adds example paths for the various locations returned on Android.

Change-Id: I55a4e23570c252cbf643596d166c7c43f023ba9c
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Ref qualified version of QImage::convertToFormat

Add ref qualified versions of QImage::convertToFormat, so that a
temporary QImage can be converted in-place to a format of equal depth.

[ChangeLog][QtGui][QImage]Added rvalue qualified convertToFormat method
for in-place conversion

Change-Id: I2eed5ffd63f5aea4ffa1147bf7607b02a49d9c5d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Work around a binary incompatibility in MSVC

The fix in b8fe5e1bbc7f341d03d2704a6110d6e3240589bb (for bug
QTBUG-27277) created two sets of begin() and end() functions for
QVector. That was required because QTypedArrayData::iterator and
QTypedArrayData::const_iterator have non-implicit copy constructors,
which means the variants returning a strict iterator need to pass the
storage pointer as an implicit first parameter. With the fix, the
compiler would emit functions with two different names for each
variant, which couldn't be merged.

If we remove those copy constructors, the compiler might be able to
generate the same code (no implicit first parameter) for both
functions.

Now, enter MSVC. Due to QPolygon, QVector<QPoint> and QVector<QPointF>
are "extern templates". That is, the compiler is not allowed to inline
anything, it must generate calls into QtCore (which we must fix for Qt
6, if we can). That means QtCore would only have one set of begin() /
end() functions. If an application tried to use the other set by
defining QT_STRICT_ITERATORS, you'd get a linker error for:

  ?begin@?$QVector@VQPoint@@@@QEAA?AViterator@?$QTypedArrayData@VQPoint@@@@V23@@Z
  (class QTypedArrayData<class QPoint>::iterator QGenericArray<class QPoint>::begin(class QTypedArrayData<class QPoint>::iterator))

Change-Id: I5c10a7d0a4855f4ba84056d313c6a800ecdcfe37
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Silence failed xcbxsettings initialization

also add a boolean flag indicating if xsettings is initialized and can
be used

Change-Id: I9dae83b8fef224171744d2b940767cbf54ce4f55
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Fix Q_ASSERT in direct2d qpa plugin

When calling end the refcount should be greater than zero, as calls to
begin/end should match.

Change-Id: I49adbf6f9f1c21cb60985ba4e02574e6c0841b74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
WinRT: Provide qmake feature for generating a package manifest

This feature (package_manifest) generates a basic application manifest
from a template provided by the mkspec or the developer. It is meant to
deliver an out-of-the-box build experience without attempting to
exhaustively cover all manifest options. It is meant to be a starting
point which allows the developer to customize the manifest further. It
also becomes the default package manifest generator for Windows Phone,
replacing autogen_wmappmanifest.

Common variables, such as the target executable, are populated by qmake
in the newly created manifest. Default icons are also created if needed,
as the build will fail without them. The input manifest can be set by
assigning a file name to WINRT_MANIFEST. Additional options are
documented in the .prf file. If an existing (non-generated) manifest is
already in the directory, it will not be overwritten.

Task-number: QTBUG-35328

Change-Id: I57576a17ff9d2b564c0828f815949cb26d276bfd
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Fix rounding issue

The correct rounding that respects ForceIntegerMetrics flag
is done just a few lines below.

Change-Id: I8e79ebaded90753092ecd3e99eece8df4c824362
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Windows: Remove unused function QWindowsBackingStore::rasterWindow().

It was only used to access the QWindow which can be retrieved
using QPlatformBackingStore::window(), potentially causing a crash
when  QWindowsBackingStore::resize() was called before the window
is shown.

Change-Id: I7c1bfce0f2c371d5d8847fd15fd1dc760b769a8f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Fix crash of tst_qaccessibilitylinux when DBus is not available.

Change-Id: I32291e4c6a5b228b42a7ec15f1dbfe4302bd31fa
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Windows: Reconstruct MSG-structure properly.

The MSG structure is supposed to contain screen coordinates of the mouse
position. Use GET_X/Y_LPARAM for mouse events and transform for
client coordinates. Use GetCursorPos() for other events.

Task-number: QTBUG-36337

Change-Id: I3ad4de20e1a460ee58f22645a4339a2444d129ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Defer HarfBuzz face loading up until it gets used

This didn't work for a loooong time already;
not it is possible to re-introduce this optimization once again.

Change-Id: I35c40e68933227bda6cbc038c2d8f6709db62451
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
eglfs: Fix quad coordinates

Prevent artifacts on raster windows by properly mapping
the coordinates to [-1,1].

Task-number: QTBUG-36370
Change-Id: I95d0d03952f597ef4ce6a950c6533a3af2df964a
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
eglfs: Remove unused variable on raspi

Change-Id: I34749533e4279d151c8954f29a4fc7635e007b19
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
eglfs: Upload only damaged areas into the textures

Uploading the pixel data for the entire window on every update
is not nice. Not sure why the line in question was added, it is
most likely a leftover from some debugging session.

Change-Id: I161af536c42ac24b299fc674039f2318f0fb8c4f
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
eglfs: Fix physical screen size regression for some hooks

On boards that provide their own custom ways of querying the screen size
the resolution of widget apps became somewhat incorrect after the recent
eglfs/eglconvenience refactor. This is because the physical size query
helper was not able to access the screenSize() provided by the hooks,
it was instead falling back to the default fb query which in turn returned
the default screen size (e.g. 800x600).

Change-Id: I46d487b61341d69dd9cb76d93198b1f44b64f195
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Disable terminal keyboard on eglfs and linuxfb

Unify the behavior for eglfs, linuxfb and kms. The relevant code is
now moved from kms into fbconvenience.

From now on, on all three platforms, terminal keyboard input is turned
off by default. This feature can be disabled by setting
QT_QPA_ENABLE_TERMINAL_KEYBOARD to 1. This is similar to what the
evdev-based keyboard handler did in QWS in Qt4.

[ChangeLog][QtGui] The main Embedded Linux platform plugins (eglfs,
linuxfb, kms) are changed to behave identically with regards to
terminal keyboard input: it is turned off by default on all of these
platforms. If this feature is not desired, it can be disabled by
setting the environment variable QT_QPA_ENABLE_TERMINAL_KEYBOARD.

Task-number: QTBUG-36394

Change-Id: I69e47ed7580464dc5e703e9a0e23891c7c8b7790
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Fix MSVC-warnings about stray */* in sources.

Change-Id: Ifa8de548dc8df79fa2b5d884383dc120661cb45a
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Fix MSVC-warnings about double to float truncation.

Change-Id: I4aef12bd8fe37dffb06fc7d0b6a330bfc42fa270
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>