[vtkusers] Enable sample buffers on QGLWidget-based VTK widget from Python

Sankhesh Jhaveri sankhesh.jhaveri at kitware.com
Thu Jun 23 09:40:37 EDT 2016


Elvis,

According to Qt documentation[1], QGLWidget is obsolete in Qt 5 and they
suggest using QOpenGLWidget (which has setFormat API).


​[1] http://doc.qt.io/qt-5/qglwidget.html
​

Sankhesh


On Thu, Jun 23, 2016 at 8:52 AM, Elvis Stansvik <
elvis.stansvik at orexplore.com> wrote:

> This is slightly off-topic, but here it goes: I have my own VTKWidget,
> similar to QVTKRenderWindowInteractor, which is based on QGLWidget. I
> wanted to enable sample buffers / samples on it, so that lines et.c. drawn
> by VTK are anti-aliased.
>
> I thought I could do
>
> glFormat = self.format()
> glFormat.setSampleBuffers(True)
> glFormat.setSamples(8)
> self.setFormat(glFormat)
>
> but it turns out setFormat is made obsolete in Qt 5, and PyQt does not
> wrap obsolete methods.
>
> Anyone know of some other way of achieving the same thing?
>
> Elvis
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160623/14ae8172/attachment.html>


More information about the vtkusers mailing list