Fix compatibility with Qt < 4.7.