[vtkusers] Trouble using VTK Widget with QVTK

Mathieu Westphal mathieu.westphal at kitware.com
Thu Jul 5 05:20:30 EDT 2018


Hi,

QVTKOpenGLWindow in 8.1.0 and 8.1.1 is very stable and is used by all
VTK/Qt based application, like ParaView for example.

Problem 1 and Problem 2 are QTCreator related. I would suggest adding a
simple QWidget in Qt creator, and once you're finished,
juste change it manually in the .ui.

Regarding Problem 3, well the answer is in the question. Juste use a
vtkGenericOpenGLRenderWindow instead of a win32 specific.
The vtkGenericOpenGLRenderWindow implementation is newer and will work on
all platform.

See attached for a QVTKOpenGLWidget usage example (found in
VTK/GUISupport/Qt/Testing/Cxx/)

Best regards,




Mathieu Westphal

On Thu, Jul 5, 2018 at 11:06 AM, andyjk <andrewkeeling at hotmail.com> wrote:

> Thanks
>
> I am on VTK 8-1
>
> I did try the qvtkOpenGLWidget but I have several problems, and I think I
> read it was still unstable.
>
> Problem 1: No QVTKOpenGLWidget in the QT designer - so I insert a
> qvtkwidget, then in the .ui file I manually change it to qvtkOpenGLWidget
> (this compiles fine).
>
> Problem 2: If I try to drag a generic OpenGL widget into a window in QT
> designer, the designer crashes and closes.
>
> Problem 3: Running the code from 1 gives me an error:
> QVTKOpenGLWidget requires a `vtkGenericOpenGLRenderWindow`. `
> vtkWin32OpenGLRenderWindow ` is not supported.
>
> I understand QVTKWidget is deprecated, but it also seems the OpenGL widget
> is too unstable at the moment ?
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> 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:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180705/99910d7c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestQVTKOpenGLWidget.cxx
Type: text/x-c++src
Size: 2550 bytes
Desc: not available
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180705/99910d7c/attachment.cxx>


More information about the vtkusers mailing list