Having created an instance of QApplication in the "main" of a file.py I run several other modules, which import others etc. In my specific case I check the connection to a SQLite3 database file and if there are problems I start a QMessageBox and pressing the OK button or with ESC the application must be terminated; however, from the module that generates the child class with which I manage the QMessageBox class, I don't know how to make the exit(app.exec()) code present in the if name == "main":
I would like to avoid passing the QApplication instance object (called "app" as usual) for each function that calls other modules up to the QMessageBox child class module!