Hi,<br><br>I will try putting a transparant widget on top. I think that might be efficient. Will keep the list updated if I make any progress.<br><br>Anja<br><br><div><span class="gmail_quote">On 16/10/06, <b class="gmail_sendername">
Clinton Stimpson</b> &lt;<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&gt; From: &quot;Anja Ende&quot; &lt;<a href="mailto:anja.ende@googlemail.com">anja.ende@googlemail.com</a>&gt;<br>&gt; Subject: [vtkusers] flickering when using QT<br>&gt; To: VTK &lt;<a href="mailto:vtkusers@vtk.org">
vtkusers@vtk.org</a>&gt;<br>&gt;<br>&gt; Hi everyone,<br>&gt;<br>&gt; So, I have managed to render above a QVTKWidget window using QT.<br>&gt;<br>&gt; However, there is one nagging problem. So, I have a set of points that I can
<br>&gt; interact with using the mouse and move them around. But whenever I move a<br>&gt; point around there is a lot of flickering. I am using Qt4 and double<br>&gt; buffering is on by default.<br>&gt;<br>&gt; Hoping that anyone who has more experience using QT with VTk might give some
<br>&gt; advise on how to achieve flicker free rendering.<br>&gt;<br>&gt; Cheers,<br>&gt;<br>&gt; Anja<br><br>Qt does double buffering by default.&nbsp;&nbsp;And returning NULL for paintEngine() tells Qt &quot;hands off&quot; for this QWidget, which means it doesn't do double buffering.&nbsp;&nbsp;The flickering you're seeing is a result of Qt doing double buffering, because you're giving it the QWidget::paintEngine().
<br><br>To compare with, the QGLWidget creates it's own QPaintEngine, instead of using QWidget::paintEngine().&nbsp;&nbsp;All paint methods are implemented in OpenGL, and double buffering is probably turned off because it isn't a default paint engine.
<br><br>Way back during the Qt4 preview, Trolltech said they might make what you're trying to do easier, in Qt 4.1 or later.&nbsp;&nbsp;4.2 is out and I don't know if they've done anything to help you.<br><br>Here's a couple ideas, some without really knowing how well they'd work:
<br>1. Find out how Trolltech was going to let us bypass the double buffer after Qt 4.0.&nbsp;&nbsp;And find a solution based on that.&nbsp;&nbsp;Here's the thread where they said that. <a href="http://lists.trolltech.com/qt4-preview-feedback/2005-04/thread00609-0.html">
http://lists.trolltech.com/qt4-preview-feedback/2005-04/thread00609-0.html</a><br>2. In your paintEvent(), do the QVTKWidget::paintEvent and do your painting into a QPixmap, and then combine the two.<br>3. Do your painting in VTK like everyone else.
<br>4. Implement your own QPaintEngine in terms of VTK, or OpenGL, if you can assume you'll only ever use OpenGL.<br>5. Put a transparent widget on top of the QVTKWidget and do your painting on that.<br><br>Clint<br><br><br>
</blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br><br>Anja