Replace QApplication by QCoreApplication in nogui main