Fix compilation with Qt < 5.3.

Change-Id: Ie8a430539e3952eb97bc18fc17b1413677e6d900
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>