I've just got there, issue now is i'm using something like:<br><br>this->ui->editLine->text()<br><br>to get the text into the edit line<br><br>but when I insert it sth like these <br>textrepresentation->SetText(this->ui->editLine->text());<br>
<br>gives me the following error:<br>2>C:\Users\RODRIGO LOVERA\Documents\QTProjects\ProyectoTesis\GUIforUSVisualization\mainwindow.cpp(1074): error C2664: 'vtkTextRepresentation::SetText' : cannot convert parameter 1 from 'QString' to 'const char *'<br>
2> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called<br><br>you know any method to do these conversion required? <br><br>And some extra question, is there any way to collocate the comments anywhere on the qvtkwidget just dragging them with the mouse??<br>
<br>Im using these code for the widget><br> this->TextWidget = vtkSmartPointer< vtkTextWidget>::New();<br> this->TextWidget->SetInteractor(this->ui->vtksurface->GetInteractor());<br><br> vtkSmartPointer< vtkTextActor > textActor =<br>
vtkSmartPointer<vtkTextActor >::New();<br> vtkSmartPointer< vtkTextRepresentation > textRep =<br> vtkSmartPointer< vtkTextRepresentation >::New();<br> textRep->SetTextActor(textActor);<br>
textRep->SetText(this->ui->lineEdit->text());<br> //textRep->SetText("Esto es una prueba");<br> this->TextWidget->SetRepresentation(textRep);<br> this->TextWidget->CreateDefaultRepresentation();<br>
<div class="gmail_extra"><br><br><div class="gmail_quote">2012/11/26 David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Nov 26, 2012 at 6:16 PM, Rodrigo Lovera <span dir="ltr"><<a href="mailto:lobo.theslayer@gmail.com" target="_blank">lobo.theslayer@gmail.com</a>></span> wrote:<br></div><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br><br>I already know how to setup vtk/qt using the qvtkwidget and got it to work the text display, well i'm using a pushButton in Qt to activate a text widget which will appear on my qvtkwidget as well as my volume rendering. My point now is how can I do to interactively write a commentary or some annotation on it.<br>
<br>I mean, I'm working with medical images and is kind of required to add some labels or commentaries in some views. Is there any direct way to add the textwidget and start typing whatever you want on the qvtkwidget?? or maybe a way to get the text of an texteditbox from qt??? I'm really stucked at this point. <br>
<br><br>Rodrigo</blockquote><div><br></div></div><div>You should use a QLineEdit and connect it's textChanged() signal to a slot that updates the vtkTextWidget and re-renders the scene:</div><div><br></div><div><a href="http://doc.qt.digia.com/qt/qlineedit.html#textChanged" target="_blank">http://doc.qt.digia.com/qt/qlineedit.html#textChanged</a></div>
<span class="HOEnZb"><font color="#888888">
<br>David</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><b><font face="'comic sans ms', sans-serif" color="#000066">Rodrigo aka WarHearT</font></b><br>
</div>