Port to Qt5(preserving Qt4 compatibility)