Don't test for hasGone in unapproved places. Now any possibility of desync on player quit is ruled out. Not tested at all.
#include <QApplication>
#include "mainform.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyWindow *mainWin = new MyWindow;
mainWin->show();
return app.exec();
}