change code to Qt4.7