various qt4 fixes

Fixes problems found on a customer project