Fix build with both qt4 and qt5