Qt5: Bulk of changes to support the move to Qt5