Make qtdeclarative compile with -no-gui

Change-Id: I0c5a55c8f6b78450b2bce693bb55e12f8a224172
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>