Make buildable/usable for Qt 5.2

NB: I have not tested this with Qt 5.1. Please do so before merging.