use qcoreapplication:exit() instead of quit()