Some Qt5 fixes and cleanup