Avoid out of bounds memory reads when scaling images

The calculation of the width/height required for the
scaling algorithm was prone to floating point rounding
issues, where the lower value got rounded down, the higher
one rounded up. This could lead to a situation where we
iterated over one more line/pixel in the line than we have
in the source image.

Correct this by passing the dimension of the source image into
the function and bounds checking the values before iterating.

Task-number: QTBUG-35927
Change-Id: If44b2235a479224660d508a0504fec40d724763a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Do not rely on the list of standard font sizes for QFontDialog.

QFontDialog should always show the correct size, even if the size
is not available in the list of standard font sizes. Native font
dialogs across common platforms show the correct size at all times.

Inside init() function, the size list requires proper initialization
since the initial value of size is zero.

Task-number: QTBUG-10317
Change-Id: Idc9e922ac95f797ac98bbf6c885e52828c4c48fd
Reviewed-by: Liang Qi <liang.qi@digia.com>
Stabilize tst_qtoolbutton for Windows 8.1.

Ensure triggered() and task176137_autoRepeatOfAction()
are using an active main window. Change click timer in
triggered() to repeat until the menu is visible and
add a timer to close the widget and bail out if the
simulated click fails to close the menu.

Task-number: QTBUG-37822
Change-Id: If675660d02335bffd5caa89796914924dad1a909
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
tst_qgraphicsproxywidget: Fix hang in actionsContextMenu().

Change the test widget to use a non-single-shot timer
to hide the menu once it has become visible.
The test shows hangs on Windows 8.1 CI nodes.

Task-number: QTBUG-37822
Change-Id: I8fc782e53256616119920aef714f89f25863b39f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
tst_qaccessibility: Introduce QTRY_VERIFY to menuTest().

Fixes failures on Windows 8.1.

Task-number: QTBUG-37822
Change-Id: I30460f430e2249555c4e857237e27aa9b03dfa1b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>