Skip to content

QVTKWidget vs QVTKWidget2 vs QVTKGraphicsItem.

Debroize René-paul edited this page Apr 14, 2014 · 6 revisions

For all of these it is impossible to draw Widget at the top of it using OSX (cocoa).

###QVTKWidget

Should Works on all plateforme, inherths from QWidget. (QPixmap::grabWidget() seemes to doesn't work with OSX if the widget is not visible)

###QVTKWidget2

Not possible to get offscreen screenshot with OSX for now (random result). QPixmap QPixmap::grabWidget() is not possible because it inherits from QGLWidget, you can use QImage QGLWidget::grabFrameBuffer() instead. This complicated the QImage medWorkspaceArea::grabScreenshot() method.

###QVTKGraphicsItem

Allow to draw on the top of the view thanks to the QtGraphics framework. the widget returned by the view has to be a QGraphicsView. works well with some work (sync of the size od the item and the view, bind between doubleClick Qt and VTK event missing) under Linux and OSX, see https://github.com/rdebroiz/medInria-public/tree/ContainerAndViewRefactoring-graphicsItem but not with windows, see : http://qt-project.org/forums/viewthread/41334/

QPixmap QPixmap::grabWidget() is still not possible but we can use the QImage QGLFrmaeBufferObject::toImage() to get around (QVTKGraphicsItem, have a QGLFrmaeBufferObject as protected member).