1

I want to use VTK 7.0.0 and Qt5 via its Python Wrappers.

In C++ I normally use QVTKWidget2 instead of QVTKWidget, in order to work around this problem rendering with intel i915 driver on Linux

Some examples on VTK+Qt+Python suggest to use the class QVTKRenderWindowInteractor, but I encounter the same rendering problem.

Digging in the source tree of VTK, I can see examples using QVTKWidget2 from Python, but I cannot find the class vtk.QVTKWidget2 after compiling VTK with the Python wrappers enabled.

Does anybody know how to compile the wrapper for QVTKWidget2, or how to work around the i915 rendering problem with QVTKRenderWindowInteractor?

Many thanks

1
  • The source for the QVTKWidget2 class is in src/GUISupport/QtOpenGL, and shows that is a subclass of QGLWidget. So you will need OpenGL installed in order to compile it all properly. Commented Mar 22, 2016 at 22:08

2 Answers 2

2

Apparently the QVTKWidgetX Python wrappers are not maintained anymore.

Nevertheless, I was able to embed VTK in qt5 from Python, without the intel i915 rendering problem, using a modified version of the class QVTKRenderWindowInteractor: I just made it inherit from QGLWidget instead of QWidget, in the same way that QVTKWidget2 uses QGLWidget as its base class and QVTKWidget uses QWidget.

Sign up to request clarification or add additional context in comments.

Comments

0

You are probably missing to enable the CMake flag Module_vtkGUISupportQtOpenGL If you use the CMake GUI, it's hidden by default as it is an advanced option...

2 Comments

Thanks for the answer, I tried that flag and still no luck. It seems to me that the wrappers for QVTKWidget are no longer maintained.
Ah, sorry to ear that. I don't use Python though. but that's the way to get access to QVTKWidget2 in C++. You should ask the mailing list, maybe someone kind enough will answer there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.