Support ResizeMode on both Qt4 and Qt5.