Improve Qt 4 compatibility