After removing gui from Qt, we have to use QCoreApplication instead of QApplication