Paraview doesn't have a way to pass pointers to QObjects from c++ to python, or vice versa. You can use PyQt wrapped methods to search for named widgets though.<br><br>Pat<br><br><div class="gmail_quote">On Thu, May 27, 2010 at 8:52 AM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Alternatively use: pqCoreUtilities::mainWidget() -- it tries to find<br>
an active mainwindow by default.<br>
<font color="#888888"><br>
Utkarsh<br>
</font><div><div></div><div class="h5"><br>
On Wed, May 26, 2010 at 7:09 PM, pat marion <<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>> wrote:<br>
>>> The only thing I couldn't immediately figure out from that post, was what<br>
>>> to do with widgets that need a parent<br>
><br>
> You could use QApplication.activeWindow(), you might get the mainwindow or<br>
> python dialog. Or you could cycle thru the list of<br>
> QApplication.topLevelWidgets() to look for the paraview mainwindow.<br>
><br>
> Pat<br>
><br>
> On Wed, May 26, 2010 at 6:27 PM, <<a href="mailto:m.c.wilkins@massey.ac.nz">m.c.wilkins@massey.ac.nz</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> On Wed, May 26, 2010 at 11:18:29AM -0400, pat marion wrote:<br>
>> > If you want to use PyQt4, see<br>
>> > <a href="http://paraview.markmail.org/message/6h767kpak5dcoqwt" target="_blank">http://paraview.markmail.org/message/6h767kpak5dcoqwt</a><br>
>><br>
>> Thank you, this is what I needed, good stuff. The only thing I<br>
>> couldn't immediately figure out from that post, was what to do with<br>
>> widgets that need a parent, because I couldn't get hold of the main<br>
>> paraview window widget. Anyway this is what I did:<br>
>><br>
>> ---<br>
>> import PyQt4.QtGui<br>
>><br>
>> # this is a dummy widget to use as the parent for other widgets that need<br>
>> a<br>
>> parent<br>
>> wid = PyQt4.QtGui.QWidget()<br>
>><br>
>> # get some user input<br>
>> ret = PyQt4.QtGui.QInputDialog.getText(wid, 'hi', 'first question')<br>
>><br>
>> # do some other stuff<br>
>><br>
>> # oh dear a warning<br>
>> ret = PyQt4.QtGui.QMessageBox.warning(wid, 'hi', 'there was a recoverable<br>
>> problem', PyQt4.QtGui.QMessageBox.Ok, PyQt4.QtGui.QMessageBox.NoButton,<br>
>> PyQt4.QtGui.QMessageBox.NoButton)<br>
>><br>
>> # maybe get some more input<br>
>> ret = PyQt4.QtGui.QInputDialog.getText(wid, 'hi', 'second question')<br>
>> ---<br>
>><br>
>><br>
>> Thanks<br>
>><br>
>> Matt<br>
>><br>
>><br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
><br>
</div></div></blockquote></div><br>