Qt4 pep8

rebase and re-target of PR #2064