Fixes for Qt 4

Last changes before going Qt 5 only