pass multiple qt flags; redefine close event