Qt: fix issue 1422 + fix formatting