take ownership of QApplication in tutorials