Qt 5: Build fixes for Qt 5 platform

Recent changes to the develop branch broke Qt 5 support.
Merge pull request #3345 from thp/develop-qt5-fixes

Qt 5: Build fixes for Qt 5 platform