Fix handling of enum values encapsulated in QVariant

In case a QJSValue contains a QVariant which wrapps an
enum value, the valueOf() method will convert the enum
to an int32.

Change-Id: I0b92207184f343d53f73884245b90552165c34fc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>