Remove C-style casts from public headers.

Task-number: QTBUG-32735

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