Build fixes for Qt 5.0.0-beta1

The qt5 branch wouldn't compile on Qt 5.0.0-beta1 without some changes.

Cheers,
Jarno