-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hi,
currently I'm trying to create an app using a multi-file approach. I've seen the examples (one file and multi file), but I find it difficult to translate some of the workings from one file to multi-file.
Broadly speaking, I'm trying to decouple the application as much as possible from the GUI. Therefore, I have e.g. a controller instance in the app_model
Application
instance. With the controller I can e.g. load a file, modify it, save it etc. without ever touching Qt.
- Is having the "business logic" (if you can call it that) on the Application instance the recommended way of doing it?
Now when I have an Action callback operating on the main window (e.g. mainWindow.open()
) in the single file approach we can just use callback=mainWindow.open
. In the multi-file approach example we can't because of circular imports (but can use QApplication
to get the window).
- How can I connect a callback to something like
mainWindow.open
? I tried using a provider there but that gets called when there is nomainWindow
yet.
It'd really help, if the same functionality of the single file app was replicated in the multi file app example.
Thanks