<br><br><div class="gmail_quote">On Jan 16, 2008 11:58 PM, Shakes &lt;<a href="mailto:Shekhar.Chandra@sci.monash.edu.au">Shekhar.Chandra@sci.monash.edu.au</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jesus,<br><br>Qt has something called Strong Focus (click and keyboard focus) option.<br>All u need to do is to set the FocusPolicy to StrongFocus, also there is<br>a help page for keyboard focusing in Qt Documentation. 
</blockquote><div><br>I&#39;ve already tried doing that. I&#39;ve set FocusPolicy to StrongFocus but with no success. I don&#39;t know what could be wrong<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Also if you have<br>multiple windows in workspace, then set active window in QWorkspace. If<br>u have multiple windows in general, then setFocus should work if called<br>from the correct spot.<br><br>Hope that helps.<br><br>
Cheers<br>Shakes<br><div><div></div><div class="Wj3C7c"><br>Jesús Spí­nola wrote:<br>&gt; Hi,<br>&gt;<br>&gt; I have an application with a main &quot;2D View&quot; based upon a QVTKWidget<br>&gt; and I would like to handle keyboard events to control the interaction.
<br>&gt; My problem is that I must click over this QVTKWidget to be aware of<br>&gt; the keyboard events, because until you click, you don&#39;t have keyboard<br>&gt; focus.<br>&gt; To avoid this &quot;first-click-to-get-keyboard-focus&quot;, I tried to call
<br>&gt; QVTKWidget-&gt;setFocus() (inherited from QWidget), which seems to be the<br>&gt; trivial solution, but It does nothing and I have to click the<br>&gt; QVTKWidget still to get the focus. I also tried invoking some vtk
<br>&gt; events, like *ButtonPressEvent, but with no succeess.<br>&gt;<br>&gt; Maybe I&#39;m missing something or I&#39;m trying to do something impossible,<br>&gt; I don&#39;t know, but it would be nice if someone can give me some hint to
<br>&gt; find out what I&#39;m doing wrong.<br>&gt;<br>&gt; So, how can I get the focus automatically?<br>&gt;<br>&gt; Thanks in advance!<br></div></div>&gt; ------------------------------------------------------------------------
<br>&gt;<br>&gt; _______________________________________________<br>&gt; This is the private VTK discussion list.<br>&gt; Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;
<br><br></blockquote></div><br>