Patched to compile with Qt 4.6