Qt5 compatibility

Ifdefs for Qt5. Alternatively I could also implement a conditional typedef if you prefer.