Fix Qt5 build. This is a mess and needs clean up :(