Changes for Qt5 compatibility

...that might have  broken Qt4 compatibility