Fix crash when compiled against Qt5