use QApplication to get the instance instead of QCoreApplication