<div dir="ltr">Hi Clinton,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I would recommend implementing a QPaintEngine for the QVTKWidget, instead of<br>
what you&#39;re trying to do. &nbsp;Then it should simply be a matter of setting a<br>
QVTKWidget as the viewport of the QGraphicsView.</blockquote><div><br><br>Hmmm... I did try something like that. I have a working vtkQtRenderWindow for Qt 4.4; which we can set as viewport for QGraphicsView. But then I wonder if the paintGL() of the viewport would blend well with the paint-sequence of graphics view. I mean we would have two potential painting sequences<br>
<br>- The viewport&#39;s paintGL() method<br>- QGraphicsView&#39;s drawBackground(), scene()-&gt;render() and drawForeground()<br><br>When we setViewport() another widget to QGraphicsView, we are basically allowing QGraphicsView to deal with all events delivered to the viewport.<br>
<br>void QAbstractScrollArea::setViewport(QWidget *widget)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // .........<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;viewport-&gt;installEventFilter(d-&gt;viewportFilter);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // .........<br>}<br><br>The viewportFilter sends all events from the viewport to the&nbsp; QAbstractScrollArea::viewportEvent(), which would essentially call event handlers in QGraphcisView to handle the event. This means that paintEvent of the viewport, will be handled in the paintEvent() of QGraphicsView. This means that the first paint-sequence (aka QGLWidget::paintGL()) will never be called.<br>
<br>Which is why I think we should do the painting in drawBackground(), which is a part of the second painting sequence; the one that actually gets executed.<br><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;">

I&#39;ve done some experimenting with a QPaintEngine for QVTKWidget before, but I<br>
haven&#39;t done enough to get something to commit into the repository. &nbsp;Do you<br>
want some of that code to play with too?</blockquote><div><br><br>Thanks, that would be great :). You could send it to me or post it to the list.<br><br>Thanks and Regards,<br>Prashanth<br><br><br></div></div><br>
</div>