[vtkusers] Example VTK with Qt

agatte agatakrason at gmail.com
Fri Aug 17 08:23:17 EDT 2012


Yes, now  it works well :

  QString fileName = QFileDialog::getOpenFileName(this, tr("Open File..."),
                                                QString(), tr("VTP-Files
(*.vtp);;All Files (*)"));

  std::string filename = fileName.toLatin1();
  vtkSmartPointer<vtkXMLPolyDataReader> reader =
vtkSmartPointer<vtkXMLPolyDataReader>::New();
  reader->SetFileName(filename.c_str());
  reader->Update();

2012/8/17 David Doria-2-3 [via VTK] <
ml-node+s1045678n5715386h15 at n5.nabble.com>

> On Fri, Aug 17, 2012 at 8:06 AM, Jothybasu Selvaraj <[hidden email]<http://user/SendEmail.jtp?type=node&node=5715386&i=0>>
> wrote:
> > use
> >
> > reader->SetFileName(filename.toLatin1());
> >
> > Jothy
>
> Jothy, that should be
>
> fileName.toLatin1()
>
> ('fileName' was the QString while 'filename' was the c_str)
>
> right? I've always just used .toStdString().c_str() - what would
> toLatin1() fix?
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://vtk.1045678.n5.nabble.com/Example-VTK-with-Qt-Load-and-Save-VTP-file-tp5715374p5715386.html
>  To unsubscribe from Example VTK with Qt[Load and Save VTP file], click
> here<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5715374&code=YWdhdGFrcmFzb25AZ21haWwuY29tfDU3MTUzNzR8LTIxODgyMDQwNQ==>
> .
> NAML<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://vtk.1045678.n5.nabble.com/Example-VTK-with-Qt-Load-and-Save-VTP-file-tp5715374p5715387.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120817/9f721968/attachment.htm>


More information about the vtkusers mailing list