Paraview doesn&#39;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">&lt;<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>&gt;</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 &lt;<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>&gt; wrote:<br>
&gt;&gt;&gt; The only thing I couldn&#39;t immediately figure out from that post, was what<br>
&gt;&gt;&gt; to do with widgets that need a parent<br>
&gt;<br>
&gt; You could use QApplication.activeWindow(), you might get the mainwindow or<br>
&gt; python dialog.  Or you could cycle thru the list of<br>
&gt; QApplication.topLevelWidgets() to look for the paraview mainwindow.<br>
&gt;<br>
&gt; Pat<br>
&gt;<br>
&gt; On Wed, May 26, 2010 at 6:27 PM, &lt;<a href="mailto:m.c.wilkins@massey.ac.nz">m.c.wilkins@massey.ac.nz</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; On Wed, May 26, 2010 at 11:18:29AM -0400, pat marion wrote:<br>
&gt;&gt; &gt; If you want to use PyQt4, see<br>
&gt;&gt; &gt; <a href="http://paraview.markmail.org/message/6h767kpak5dcoqwt" target="_blank">http://paraview.markmail.org/message/6h767kpak5dcoqwt</a><br>
&gt;&gt;<br>
&gt;&gt; Thank you, this is what I needed, good stuff.  The only thing I<br>
&gt;&gt; couldn&#39;t immediately figure out from that post, was what to do with<br>
&gt;&gt; widgets that need a parent, because I couldn&#39;t get hold of the main<br>
&gt;&gt; paraview window widget.  Anyway this is what I did:<br>
&gt;&gt;<br>
&gt;&gt; ---<br>
&gt;&gt; import PyQt4.QtGui<br>
&gt;&gt;<br>
&gt;&gt; # this is a dummy widget to use as the parent for other widgets that need<br>
&gt;&gt; a<br>
&gt;&gt; parent<br>
&gt;&gt; wid = PyQt4.QtGui.QWidget()<br>
&gt;&gt;<br>
&gt;&gt; # get some user input<br>
&gt;&gt; ret = PyQt4.QtGui.QInputDialog.getText(wid, &#39;hi&#39;, &#39;first question&#39;)<br>
&gt;&gt;<br>
&gt;&gt; # do some other stuff<br>
&gt;&gt;<br>
&gt;&gt; # oh dear a warning<br>
&gt;&gt; ret = PyQt4.QtGui.QMessageBox.warning(wid, &#39;hi&#39;, &#39;there was a recoverable<br>
&gt;&gt; problem&#39;, PyQt4.QtGui.QMessageBox.Ok, PyQt4.QtGui.QMessageBox.NoButton,<br>
&gt;&gt; PyQt4.QtGui.QMessageBox.NoButton)<br>
&gt;&gt;<br>
&gt;&gt; # maybe get some more input<br>
&gt;&gt; ret = PyQt4.QtGui.QInputDialog.getText(wid, &#39;hi&#39;, &#39;second question&#39;)<br>
&gt;&gt; ---<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks<br>
&gt;&gt;<br>
&gt;&gt; Matt<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
</div></div><div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>