Ported to Qt 4.8