Fix build using qt < 4.7 Closes #1385