Compatibility with some older compilers (eg as used on Travis CI).
Removed unnecessary typedef keyword.
Explicit cast to avoid (valid) compiler warnings (see the QVariant::type() documentation).