Fix bugs for Qt5.