Replace use of C-style cast with something that is not a cast.

Avoids a warning in user code. We should add -Wold-style-cast to our
header checks.

Task-number: QTBUG-32735
Change-Id: Ic284e3a5df56789d51484364b34a9ebc026bb20a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>