[vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and size policy questions

Elvis Chen elvis.chen at gmail.com
Thu May 24 16:37:40 EDT 2018


Hi all,

I have 2 questions related to the integration of QVTKOpenGLWidget into Qt Designer and sizing policy, I seek your help.

First of, I’ve installed both 32/64-bits of Qt 5.10.1 onto my Windows 10 environment. I am using Visual Studio 2015 Enterprise edition, CMake 3.11.2, and vtk 9.0. Everything was compiled as 32bit application.

Question #1: 

In order to integrate QVTKOpenGLWidget into Qt Designer, I had to copy QVTKWidgetPlugin.dll/pdb into a path that’s accessible to Qt Designer. There is no QVTKOpenGLWidgetPlugin.* as far as I can tell. In Qt Designer, I do have access to QVTKWidget but not QVTKOpenGLWidget.

The generated .ui file hence contained QVTKWidget and I had to manually edit the .ui file to replace QVTKWidget with QVTKOpenGLWidget.

Is this the correct way of doing things?  Is manual editing required?

Question #2:

I tried to follow VTK/Qt examples such as https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/.  Suppose I have generated a Qt app based on QMainWindow, with a QWidget as the centralWidget and a QVTKOpenGLWidget on top of the centralWidget (as seen on the example above).  This was accomplished using Qt Designer and the resulting .ui file resembles to the example above.

While it works, I am having difficulties in setting up the size policy.  In short, no matter what sizePolicy I set to both (or either) the QWidget and QVTKOpenGLWidget, their sizes are fixed. If I maximize the window, the QVTKOpenGLWidget does not maximize.

Can anyone shed some light into this issue?  I can attach the .ui file if it is appropriate.

Any help is very much appreciated,

--
Elvis C.S. Chen, PhD, LEL

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180524/f2fe0e8a/attachment.html>


More information about the vtkusers mailing list