Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QVTKRWIBase default value #498

Merged
merged 1 commit into from
Dec 17, 2019
Merged

Fix QVTKRWIBase default value #498

merged 1 commit into from
Dec 17, 2019

Conversation

GuillaumeFavelier
Copy link
Contributor

@GuillaumeFavelier GuillaumeFavelier commented Dec 12, 2019

Update the default class chosen by QVTKRenderWindowInteractor depending on the version of vtk.
The fix was suggested by @math-artist.

To reproduce, using the version 8.2 of vtk:

On my configuration, before:

>>> import pyvista
>>> import vtk
>>> vtk.qt.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.__bases__
(<class 'PyQt5.QtWidgets.QWidget'>,)

With this patch:

>>> import pyvista
>>> import vtk
>>> vtk.qt.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.__bases__
(<class 'PyQt5.QtOpenGL.QGLWidget'>,)

Closes #473

@GuillaumeFavelier
Copy link
Contributor Author

I used vtk.vtkVersion for the check but I could use scooby too I think. Is there a way to get the major/minor version only? Maybe you know a way to do it better @banesullivan

Copy link
Member

@banesullivan banesullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@banesullivan
Copy link
Member

I used vtk.vtkVersion for the check but I could use scooby too I think. Is there a way to get the major/minor version only? Maybe you know a way to do it better @banesullivan

The way you did it works well! Scooby returns the full version string so it would require extra parsing. The way you handle the version is the best way I can think of doing it

@banesullivan banesullivan added this to the 0.23.0 milestone Dec 13, 2019
@banesullivan banesullivan merged commit 4d8e2f0 into master Dec 17, 2019
@banesullivan banesullivan deleted the fix_qvtkrwibase branch December 17, 2019 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PyVista may be using QWidget instead of QGLWidget for VTK 8.2
2 participants