Added support for specifying whether the application is a QApplication or a QCoreApplication.