<div dir="ltr"><div>Thanks Nyall!!! Unfortunately I was trying to make this a processing routine when I shouldn't have. It is good to know the boundaries. This function really requires user interactivity. <br></div><div><br></div><div>Calvin<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 30, 2018 at 9:27 PM, Nyall Dawson <span dir="ltr"><<a href="mailto:nyall.dawson@gmail.com" target="_blank">nyall.dawson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, 30 Aug 2018 at 23:38, C Hamilton <<a href="mailto:adenaculture@gmail.com">adenaculture@gmail.com</a>> wrote:<br>
><br>
> I have an algorithm that during execution gathers information from the data and then pops up a window for the user to select what the user would like to do.<br>
><br>
> Is this possible in the Processing framework? I have tried doing this in processAlgorithm and it crashes QGIS. Here is how I call the popup window.<br>
<br>
</span>No - this is not supported and goes against the very fundamental<br>
design of Processing. Argggh! ;)<br>
<br>
But seriously, Processing was designed with the intention that all<br>
user choices are made up-front. This allows algorithms to be nicely<br>
executed inside of models, without the model halting mid-way waiting<br>
for user input. It also allows algorithms, scripts, models, etc to be<br>
run from headless environments such as console scripts.<br>
<br>
In this case, you're getting a crash because you're trying to create<br>
GUI components from your algorithm which is being executed in a<br>
background thread. This is a big no-no in Qt land, and usually results<br>
in a crash.<br>
<span class="HOEnZb"><font color="#888888"><br>
Nyall<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
>         fieldsDialog = SelectionDialog(self.<wbr>tableFeatures)<br>
>         fieldsDialog.exec_()<br>
>         items = fieldsDialog.selected<br>
><br>
> Here is the beginning of the SelectionDialong class.<br>
><br>
> class SelectionDialog(QDialog, FIELDS_CLASS):<br>
>     def __init__(self, feat, parent=None):<br>
>         super(SelectionDialog, self).__init__(parent)<br>
>         self.setupUi(self)<br>
><br>
> Prior to Processing I passed in iface.mainWindow() as the parent. Is there a proper parent in Processing to pass? Perhaps this is the reason it is crashing.<br>
><br>
> class SelectionDialog(QDialog, FIELDS_CLASS):<br>
>     def __init__(self, iface, feat):<br>
>         super(SelectionDialog, self).__init__(iface.<wbr>mainWindow())<br>
>         self.setupUi(self)<br>
><br>
> Thanks,<br>
><br>
> Calvin<br>
</div></div></blockquote></div><br></div>