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

Elvis Stansvik elvis.stansvik at orexplore.com
Thu Jun 23 10:21:12 EDT 2016


2016-06-23 15:40 GMT+02:00 Sankhesh Jhaveri <sankhesh.jhaveri at kitware.com>:

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

Yes, I know, but I've based my class on QVTKRenderWindowInteractor, which
still uses QGLWidget. So I was looking for some alternative way of doing it
with QGLWidget.

Howeve, I've now begun looking into porting my class to QOpenGLWidget,
taking inspiration from QVTKWidget2 and this SO answer:
http://stackoverflow.com/a/26946040/252857

But I've hit some snags (will make another post about it).

Elvis


>
> ​[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/9382e521/attachment.html>


More information about the vtkusers mailing list