Mitigate performance regression in isExpandedEntityValueTooLarge().

512a1ce0698d370c313bb561bbf078935fa0342e fixed a security issue [1],
but also caused a large performance regression. This patch improves
the performance from ~196 seconds to ~.23 seconds for 1000 entities,
using the benchmark in the bug report:

"0": 0 msecs per iteration (total: 0, iterations: 1)
"250": 2,952 msecs per iteration (total: 2,952, iterations: 1)
"500": 23,418 msecs per iteration (total: 23,418, iterations: 1)
"750": 79,913 msecs per iteration (total: 79,913, iterations: 1)
"1000": 196,335 msecs per iteration (total: 196,335, iterations: 1)

"0": 0 msecs per iteration (total: 0, iterations: 1)
"250": 16 msecs per iteration (total: 16, iterations: 1)
"500": 59 msecs per iteration (total: 59, iterations: 1)
"750": 132 msecs per iteration (total: 132, iterations: 1)
"1000": 232 msecs per iteration (total: 232, iterations: 1)

This is a cherry-pick of 62c4e288a11769bde45c9c74d731ed8628303f19.

[1] http://lists.qt-project.org/pipermail/announce/2013-December/000036.html

Task-number: QTBUG-35919

Change-Id: Ibc2fc94dc0d88b227b9510e15bac9c07f4600591
Reviewed-by: Richard J. Moore <rich@kde.org>
Avoid floating point exceptions in rasterizeLine.

Task-number: QTBUG-16757

Change-Id: I3ef988f1e039c12529d62197d85a62f201e4ae12
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
(cherry picked from qtbase/85b4f0d2d3ffd326548ca8f0e15ac27f5fd8d77d)
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Correct wordwrapped text handling in QListView icon mode

Currently a QListView with wordwrapping activated will wrap the text
only to the width of the icon even if the grid size is bigger. With this
patch the option rect is now updated to match the grid size if valid
and the style uses it to determine the correct size when wrapping

[ChangeLog][QtWidgets][QTBUG-4714] Use the grid size for wordwrapping
when available in icon mode
Task-number: QTBUG-4714
Change-Id: I2cb63809d3ee8bd262f38bc11de91df9ff5cf237
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
(cherry picked from qtbase/a761be2fb2191215426f904cb03df0e966214531)
QWizard: Fix frame when using Vista style/MSVC2012

Work around GetSystemMetrics() returning the wrong value using
MSVC2012 and later. The special handling of Windows 8 and later
is then no longer required.

[ChangeLog][QtWidgets][QWizard]  Fixed frame when using Vista style/MSVC2012.

Task-number: QTBUG-36192

Change-Id: I39c2ab70a266f12cd65fa740b10b86edffa60417
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/852308114ff901b86cca99268f498fc1d56b622e)