tidied up the Qt sample a bit