Fix hard dep on widgets for autotests

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