from PyQt6.QtCore import QObject, pyqtSlot class Controller(QObject): def __init__(self, window, parent=None): super().__init__(parent) self.window = window @pyqtSlot() def test_function(self): print("test function") self.window.running = False