Yes, now  it works well :<div><br></div><div><div> <font color="#ff0000"> QString fileName = QFileDialog::getOpenFileName(this, tr(&quot;Open File...&quot;),</font></div><div><font color="#ff0000">                                                QString(), tr(&quot;VTP-Files (*.vtp);;All Files (*)&quot;));</font></div>
<div><font color="#ff0000">    </font></div><div><font color="#ff0000">  std::string filename = fileName.toLatin1();</font></div><div><font color="#ff0000">  vtkSmartPointer&lt;vtkXMLPolyDataReader&gt; reader = vtkSmartPointer&lt;vtkXMLPolyDataReader&gt;::New();</font></div>
<div><font color="#ff0000">  reader-&gt;SetFileName(filename.c_str());</font></div><div><font color="#ff0000">  reader-&gt;Update();</font></div><br><div class="gmail_quote">2012/8/17 David Doria-2-3 [via VTK] <span dir="ltr">&lt;<a href="/user/SendEmail.jtp?type=node&node=5715387&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt;</span><br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">

        On Fri, Aug 17, 2012 at 8:06 AM, Jothybasu Selvaraj &lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=5715386&amp;i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>&gt; wrote:
<br>&gt; use
<br>&gt;
<br>&gt; reader-&gt;SetFileName(filename.toLatin1());
<br>&gt;
<br>&gt; Jothy
<br><br>Jothy, that should be
<br><br>fileName.toLatin1()
<br><br>(&#39;fileName&#39; was the QString while &#39;filename&#39; was the c_str)
<br><br>right? I&#39;ve always just used .toStdString().c_str() - what would toLatin1() fix?
<br><br>David
<br></div><div class="im">_______________________________________________
<br>Powered by <a href="http://www.kitware.com" target="_blank" rel="nofollow" link="external">www.kitware.com</a>
<br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="nofollow" link="external" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="nofollow" link="external" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:
<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" rel="nofollow" link="external" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>

        
        
        
        <br>
        <br>
        </div><hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div class="im">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </div><a href="http://vtk.1045678.n5.nabble.com/Example-VTK-with-Qt-Load-and-Save-VTP-file-tp5715374p5715386.html" target="_blank" rel="nofollow" link="external">http://vtk.1045678.n5.nabble.com/Example-VTK-with-Qt-Load-and-Save-VTP-file-tp5715374p5715386.html</a>
        </div><div class="HOEnZb"><div class="h5">
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Example VTK with Qt[Load and Save  VTP file], <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>

                <a href="http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></div></div></blockquote></div><br></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Example-VTK-with-Qt-Load-and-Save-VTP-file-tp5715374p5715387.html">Re: Example VTK with Qt</a><br/>
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html">VTK - Users mailing list archive</a> at Nabble.com.<br/>