Get rid of qobject_cast where possible.

If a class assumes parent to be of known type, state it explicitly in the
sources.