Prepare for Qt5 build.
Some api hacks.