Revert partially "Remove some unused code and forward declarations"

The setParent function was used by the qml designer!

This reverts commit 8cb3b016885a861fcd2af24e559e768eabecc3ae.

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