My main problem is the QCoreApplication::exit() thing which I dont understand, but I know is VERY neccesary for running a kill script before the application terminates....