<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:DotumChe;
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@DotumChe";
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@Malgun Gothic";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi Clint,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Actually I tried to use QVTKInteractor as follows:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>imageViewer1_open-&gt;SetupInteractor(<span style='color:blue'>this</span>-&gt;ui-&gt;qvtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor());</span><span style='font-size:10.0pt;font-family:DotumChe'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> …<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>this</span><span style='font-size:10.0pt;font-family:DotumChe'>-&gt;ui-&gt;qvtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;Start();</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>However, still the same problem occurred. Could you please let me know what mistakes I made?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thank you,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Xiaopeng<o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> clinton@elemtech.com [mailto:clinton@elemtech.com] <br><b>Sent:</b> Saturday, June 25, 2011 10:04 AM<br><b>To:</b> Xiaopeng Yang; 'vtk'; insight-users@itk.org<br><b>Subject:</b> Re: [vtkusers] QT, VTK, and ITK combined program exit problem<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>If you are using Qt, the event loop should be handled by Qt, not VTK with the iren-&gt;start.<br>Also be sure to use the QVTKInteractor instead of the type from the factory method vtkRenderWindowInteractor::New.<br><br>Clint<o:p></o:p></span></p><div id="htc_header"><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>----- Reply message -----<br>From: &quot;Xiaopeng Yang&quot; &lt;yxp233@postech.ac.kr&gt;<br>Date: Fri, Jun 24, 2011 6:42 pm<br>Subject: [vtkusers] QT, VTK, and ITK combined program exit problem<br>To: &quot;&amp;apos;vtk&amp;apos;&quot; &lt;vtkusers@vtk.org&gt;, &lt;insight-users@itk.org&gt;<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'>Hi All,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I found where the problem is: “iren-&gt;Start()”. “iren” is the vtkRenderWindowInteractor I defined in my program. If I delete this sentence “iren-&gt;Start()”, then I can close both GUI and console windows without warning message “QObject::killTimers: timers cannot be stopped from another thread”. Otherwise, the problem I described in the previous Email will occur. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>However, for seed point selection, I need “iren-&gt;Start()”. Then what should I do to solve the problem?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Best,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Xiaopeng<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>Xiaopeng Yang<br><b>Sent:</b> Friday, June 24, 2011 4:07 PM<br><b>To:</b> 'vtk'; insight-users@itk.org<br><b>Subject:</b> [vtkusers] QT, VTK, and ITK combined program exit problem<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Dear Users,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I made a program based on QT, VTK, and ITK. When I run the program, there are GUI window and console window. When I click “exit” button in the GUI window, the GUI window exits but the console window doesn’t. When I click “exit” button in the console window, there is a message: QObject::killTimers: timers cannot be stopped from another thread. If someone already had a similar experience, please could you share your knowledge?<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thank you very much.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Best regards,<o:p></o:p></p></div></body></html>