Final fixes for Qt5 support

Qt 4.8.x has now been deprecated.