fix crash when bringing up a QGuiApplication instead of QApplication

Change-Id: I9fbc13d1e32952a68f9b7061cbd37b4fcf085612