<pre><font size="2"><span style="font-family: tahoma,sans-serif;">Hi<br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> I tried to use the recommended method below in my ParaView plugin:<br>
<br><br><br> // Get Application Core<br>  pqApplicationCore* core = pqApplicationCore::instance();<br><br>  // Get Object Builder to create new Views, Server etc<br>  pqObjectBuilder* builder = core-&gt;getObjectBuilder(); <br>
<br>  // Get the Server Manager Model so that we can get current server<br><br>  pqServerManagerModel* serverManager = core-&gt;getServerManagerModel();<br>  <br>  if (serverManager-&gt;getNumberOfItems&lt;pqServer*&gt;()== 1) // Assuming that there is only 1 server<br>
<br>  {<br>          pqServer* server = serverManager-&gt;getItemAtIndex&lt;pqServer*&gt;(0); <br><br>          if (serverManager-&gt;getNumberOfItems&lt;pqView*&gt; () == 1) // Assuming that there is only 1 view created<br>          {<br>                  pqView* view1 = serverManager-&gt;getItemAtIndex&lt;pqView*&gt;(0);<br>
<br>                 <br>                  // Get QWidget from first view  <br><br>                  QWidget* viewWidget = view1-&gt;getWidget();<br>                  //Create GridLayout Widget from first view&#39;s widget<br>                  QGridLayout* gl  = new QGridLayout(viewWidget);<br>
<br>                                  //create second view<br><br>                  pqRenderView* view2 = qobject_cast&lt;pqRenderView*&gt;(<br>                          builder-&gt;createView(pqRenderView::renderViewType(), server));<br>                                  //Add second view&#39;s widget to gridlayout<br>
<br><br>                  gl-&gt;addWidget(view2-&gt;getWidget(),1,1);<br><br>                  //Create third view<br>                 <br>                                   //create third view<br>                  pqRenderView* view3 = qobject_cast&lt;pqRenderView*&gt;(<br>                          builder-&gt;createView(pqRenderView::renderViewType(), server));<br>
<br><br>                                  //Add third view&#39;s widget to gridlayout<br>                           gl-&gt;addWidget(view3-&gt;getWidget(),2,2);<br>          }<br>  }<br><br>The debugger fails at<br></span></span></font><font size="2"><span style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;">pqRenderView* view3 = qobject_cast&lt;pqRenderView*&gt;(<br>
                          builder-&gt;createView(pqRenderView::renderViewType(), server));</span></span></font><br><font size="2"><span style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"><br>pqObjectBuilder.cxx : pxm-&gt;RegisterProxy(&quot;views&quot;, name.toAscii().data(), proxy);<br>
qwidget.h: inline QSize QWidget::size() const { return data-&gt;crect.size(); }<br><br>because data is null. <br> </span></span></font><font size="2"><span style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"><br>
<br>name.toAscii is &quot;RenderView3&quot;.  <br><br>Can someone let me know what I mess up in the code? Thanks.<br></span><br></span><span style="font-family: tahoma,sans-serif;"><i> </i></span><font size="2"><i style="font-family: tahoma,sans-serif;"><br>

</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; On Thu, Mar 18, 2010 at 11:22 AM, Utkarsh Ayachit<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; &lt;<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">utkarsh.ayachit at kitware.com</a>&gt; wrote:<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; Hello,<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; If you are creating a custom application which always has 4 render<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; windows, then I&#39;d suggest not even using the pqViewManager.<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; Simply create the 4 views yourself and pack them into a QWidget using<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; a QGridLayout. For example, the following code can be used after a<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; server connection has been made to set up the 4 views.<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; QWidget* centralWidget = new QWidget();<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; mainWindow-&gt;setCentralWidget(centralWidget);<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; QGridLayout* gl  = new QGridLayout(centralWidget);<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; for (int xx=0; xx &lt; 2; xx++)<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; {<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;  for (int yy=0; yy &lt; 2; yy++)<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;    {<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;    pqRenderView* view = qobject_cast&lt;pqRenderView*&gt;(<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;      ob-&gt;createView(pqRenderView::renderViewType(), server));<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;    gl-&gt;addWidget(view-&gt;getWidget(), yy, xx);<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;    }<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; }<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; Utkarsh<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; On Thu, Mar 18, 2010 at 10:22 AM, Adebayo Olowoyeye<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &lt;<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">aolowoye at umail.iu.edu</a>&gt; wrote:<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; Hi,<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; I am attempting to use the Clone2 CustomApplication example to write a<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; custom application in C++.  The wiki documentation on Custom<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; Applications<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; suggest using pqViewManager to control the view of the application.<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; I want to split the frame into four different windows, each with its<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> own<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; view.  I am assuming the program starts with one frame and one view.<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> Is<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; this assumption correct?<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; I reference the pqViewManager with the following code:<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;        this-&gt;Internals-&gt;MultiViewManager<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; the active view (I&#39;m guessing the only view at this point is):<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;        pqView* view =<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; this-&gt;Internals-&gt;MultiViewManager-&gt;getActiveView();<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; This problem is there are no public methods to split the frame in<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; pqViewManager.  It is possible to get the pqMultiViewFrame:<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;         pqMultiViewFrame * multiViewFrame =<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; this-&gt;Internals-&gt;MultiViewManager-&gt;getFrame(view);<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; I&#39;ve tested this by:<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;         multiViewFrame-&gt;setTitle(&quot;HELLO WORLD!&quot;);<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; and it works, but I&#39;ve tried multiple tries to get the frame to split<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; without success.  Any insight will help.<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; Thanks!<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; _______________________________________________<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; Visit other Kitware open-source projects at<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; Please keep messages on-topic and check the ParaView Wiki at:<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>

</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br>
</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;&gt; &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; _______________________________________________<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; Visit other Kitware open-source projects at<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; Please keep messages on-topic and check the ParaView Wiki at:<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; Follow this link to subscribe/unsubscribe:<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;<br></i><span style="font-family: tahoma,sans-serif;">&gt;</span><i style="font-family: tahoma,sans-serif;"> &gt;<br>


</i><span style="font-family: tahoma,sans-serif;">&gt;</span></font></font><i><font size="2"><br></font></i></pre><br clear="all"><br clear="all"><br>-- <br>Alexis YL Chan <a href="http://alexisylchan.wordpress.com/" target="_blank"></a><br>