I'm trying to open a modeler dialog from a Python plugin using a given .model3 file.
The problem is that the dialog closes immediately even though it seems to successfully load the model file.
I used the post below as a sample, which is pretty much the same but through the Python console:
Running the Graphic Modeler from the Python Console in QGIS
Using the console does work, but through a connect (click) event from a plugin, the window closes immediately.
The dialog code:
dlg = ModelerDialog()
dlg.loadModel('C:/BGTGenerator.model3')
dlg.show()
How can I prevent the modeler dialog from closing or open it correctly from a plugin?
self.mod_dlg = ModelerDialog()
in the__init__()
method of your main plugin class. Then in your slot method doself.mod_dlg.loadModel('C:/BGTGenerator.model3')
;self.mod_dlg.show()