Allow floating point pixel sizes for Context2D, don't set if invalid.

Currently, setting a floating point pixel size for context2d's font
will result in the following error:

QFont::setPixelSize: Pixel size <= 0 (0)

This is because qt_font_from_string() uses toInt() to convert
the number to an int, which fails because of the decimal fraction.
The font size is then set regardless (to 0), which does not comply with
the standard:

"[...] If the new value is syntactically incorrect (including using
property-independent style sheet syntax like 'inherit' or 'initial'),
then it must be ignored, without assigning a new font value. [CSS]" [1]

This patch makes qt_font_from_string() call toFloat() on the string and
then casts the value to an int. I could not find any evidence that
floating point pixel sizes are disallowed, and QFont only deals with
integer sizes anyway.

If the conversion to float fails, the font size is not set (it defaults
to 10px, according to [2]).

[1] http://www.w3.org/TR/2dcontext/#dom-context-2d-font
[2] http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-context2d.html#font-prop

Change-Id: I6204eaa9fb6048bb9c4452403c3a4cf2913a03a1
Reviewed-by: Alan Alpert <aalpert@blackberry.com>