How to decide between QVTKOpenGL{Native}Widget?

I strongly think that is the best way i.e. prefer QVTKOpenGLNativeWidget over QVTKOpenGLWidget – except when quad buffer stereo is needed. The native widget is better approach since the non-native widget relies on QWidget::createWindowContainer which has a slew of complications including poor support on macOS and issues with how events from parent QWidget are forwarded to the internal QWindow.

A separate but perhaps related issue is that I think the widget naming is woefully confusing. I would expect QVTKOpenGLWidget to be a subclass of QOpenGLWidget but it is not. I would recommend we rename the classes as follows:

  1. QVTKOpenGLWidget – currently called QVTKOpenGLNativeWidget, subclass of QOpenGLWidget
  2. QVTKOpenGLWindow – subclass of QOpenGLWindow; this is same as now.
  3. QVTKOpenGLWindowContainerWidget – this is the QWidget subclass that uses QWidget::createWindowContainer to internally manage a QVTKOpenGLWindow for the actual rendering; currently called QVTKOpenGLWidget.
1 Like