[vtkusers] QVTKWidget paintEvent

Leonardo M. Ramé l.rame at griensu.com
Fri Sep 24 14:03:21 EDT 2010


On 2010-09-24 09:28:24 -0600, Clinton Stimpson wrote:
> On Friday, September 24, 2010 09:10:30 am Leonardo M. Ramé wrote:
> > On 2010-09-24 08:45:31 -0600, Clinton Stimpson wrote:
> > > On Friday, September 24, 2010 07:52:48 am Leonardo M. Ramé wrote:
> > > > Hi, can paint over a QVTKWidget, however my drawings are lost when I
> > > > click on the widget or after setting a vtkImageViewer2 into it.
> > > > 
> > > > This is the code I use to paint over the QVTKWidget:
> > > > 
> > > > QPaintEngine * myWidget::paintEngine() const
> > > > {
> > > > 
> > > >   return QWidget::paintEngine();
> > > > 
> > > > }
> > > > 
> > > > void myWidget::paintEvent(QPaintEvent * e)
> > > > {
> > > > 
> > > >   QVTKWidget::paintEvent(e);
> > > >   QPainter paint(this);
> > > >   paint.setPen(Qt::white);
> > > >   paint.drawRect(5,5,10,10);
> > > > 
> > > > }
> > > > 
> > > > How can I let my drawings repaint over the image viewer
> > > 
> > > If you want to use QPainter, you'll have to use the new QVTKWidget2 in
> > > the git repository.  Otherwise, you'll have to use VTK classes to do
> > > that drawing.
> > > 
> > > Clint
> > 
> > Thanks Clint. Do you know if the QVTKWidget2 support rendering
> > vtkImageViewer2?.
> 
> It should work.
> 
> Clint

Sorry, but it doesn't. 

I replaced the directory GUISupport/Qt from 5.6.0 with the one from git,
and I got many errors like this:

VTK/GUISupport/Qt/QVTKGraphicsItem.h:36: error: forward declaration of ‘struct vtkGenericOpenGLRenderWindow’

Do I have to download all vtk files from git repository to compile the
new QVTKWidget2 ?


-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com



More information about the vtkusers mailing list