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> <<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>> 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>> From: "Anja Ende" <<a href="mailto:anja.ende@googlemail.com">anja.ende@googlemail.com</a>><br>> Subject: [vtkusers] flickering when using QT<br>> To: VTK <<a href="mailto:vtkusers@vtk.org">
vtkusers@vtk.org</a>><br>><br>> Hi everyone,<br>><br>> So, I have managed to render above a QVTKWidget window using QT.<br>><br>> However, there is one nagging problem. So, I have a set of points that I can
<br>> interact with using the mouse and move them around. But whenever I move a<br>> point around there is a lot of flickering. I am using Qt4 and double<br>> buffering is on by default.<br>><br>> Hoping that anyone who has more experience using QT with VTk might give some
<br>> advise on how to achieve flicker free rendering.<br>><br>> Cheers,<br>><br>> Anja<br><br>Qt does double buffering by default. And returning NULL for paintEngine() tells Qt "hands off" for this QWidget, which means it doesn't do double buffering. 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(). 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. 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. And find a solution based on that. 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